Lukas Smith wrote:
Stanislav Malyshev wrote:

I 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
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.


Andrey

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to