Re: forward compatibility "public" in 4.4
| From: | Andrey Hristov | Date: | Wed, 15 Jun 2005 22:12:08 +0000 |
| Subject: | Re: forward compatibility "public" in 4.4 | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-16710@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
Stanislav Malyshev wrote:comments /* abstract */ class FooBar { /* public */ var $public; /* protected */ var $protected; /* private */ var $private; /* private */ function __construct(/*PHP5*/$var) {} } When moving to PHP 5 simple search and replace does the job. All places marked with /*PHP5*/& are replaced with empty string - thus unnecessary references in the code are removed. The code base be easily preprocessed and one code base can be used in most cases to be run under 4 and 5. AndreyI wonder what was the original purpose of PHP5 emitting warning when seeing 'var'? What are you basically saying now is "I want PHP4 code that wouldn't have messages on my class vars if run in PHP5". But I'm sure there was some idea behind these warnings, not?There was a reason. So that people who mark things "var" because there was no true PPP available will be notified that they are using deprecated syntax. To quote Andi "It was meant to help people find var's so that they can be explicit about the access modifiers." So to me it seems if I have no private/protected, but only public properties I would like to be able to preempt a needless warning as I migrade to PHP5. I dont agree however we should make protected and private simply behave as var in PHP 4.x as this would indeed just undermine the entire point of the E_STRICT warning. regards, Lukas I started long ago to prepare code for PHP 5 migration by adding some hint