You are here: Re: Loading of required data « PHP Programming Language « IT news, forums, messages
Re: Loading of required data

Posted by Jerry Stuckle on 08/02/07 21:23

gosha bine wrote:
> Armando Padilla wrote:
>> Rik wrote:
>>> On Thu, 02 Aug 2007 19:47:23 +0200, gosha bine <stereofrog@gmail.com>
>>> wrote:
>>>> php only includes files when the require/include statements are
>>>> executed, in other words
>>>>
>>>> $x = 1;
>>>>
>>>> if(1 == $x)
>>>> require("include this");
>>>> else
>>>> require("this-will-be-NEVER-included");
>>>
>>> Since 4.0.2, then again, anyone running a lower version really should
>>> upgrade....
>> Ah ok, thanks. so nothing gets placed into mem if its not reached,
>> gotcha. I though it was the case that all required docs were called
>> when creating the intermediate code on the engine and then depending
>> on the if-else statement the required doc would be executed or not.
>>
>
> That would be cool, but hardly possible, because includes can be (and
> mostly are) dynamic:
>
> include $my_file_name;
>
>
>

It used to be before PHP 4.0.2. include was processed when the file was
parsed, not when it was executed, just like in other languages such as
C, C++ and Java. PHP is now a little more discriminating :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация