At 19:39 20/02/2002, Ford, Mike               [LSS] wrote:
>I can find nothing in the PHP4 ChangeLog, or in the bugs database, that 
>mentions such a change.
>
>(1) Has this, indeed, changed?

Yes.

>(2) If so, shouldn't the ChangeLog mention it, and the manual document 
>which version it changed in?

It would be a good idea, yes.  It's not that important, though, as it has 
virtually no negative symptoms.

>(3) ... and why the change?  The first behaviour seems extremely useful 
>for not include()ing files which aren't really needed!

I guess you didn't understand the change - require() became like include(), 
not the other way around. That means you can selectively require() files, 
inside if() statements or inside functions, something you couldn't do 
before (beforehand, require()'d files were always processed).

The change was made because the performance benefit from require() was 
related to the PHP 3 architecture, which is no longer relevant.  Removing 
it made it possible to share code between include() and require(), and it 
made require() faster in some cases (e.g., if you have a require() inside 
an if() statement, which evaluates to false, the require()'d file will not 
be processed).

Zeev


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

Reply via email to