On Wed, 24 Mar 2004, Stanislav Malyshev wrote:

> RL>> The example was something like:
> RL>> 
> RL>>   class foo {
> RL>>     function foo() {
> RL>>        legacy generic constructor code
> RL>>     }
> RL>>     function __construct() {
> RL>>        php5-specific stuff
> RL>>        $this->foo();  // chain to legacy constructor code
> RL>>     }
> RL>>   }
> RL>> 
> RL>> A bit contrieved, but when this class runs under PHP5 it would run the 
> RL>> additional PHP5-specific code and when it runs under PHP4 it wouldn't.
> 
> What is "php5-specific stuff" here? If there are some PHP5-specific 
> constructs, they won't just run under PHP4, so the class is unusable 
> under PHP4 anyway, not? Could you give me real-life example of someone 
> using this to do something?

There are a number of changes between PHP4 and PHP5 that aren't strictly
syntactical but rather behavioural so while the code itself will pass the
php4 syntax check, it would not run as intended and thus be PHP5 only.  
It could also be that this isn't in the same class.  You might simply be
extending a legacy PHP4 class with code specific to PHP5 and you don't
want to change the legacy class.  I suppose I could write up a realworld
example of this, but I don't think it is that obtuse.

-Rasmus

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

Reply via email to