Re: Include question

From: Date: Sun, 02 Jun 2002 13:13:44 +0000
Subject: Re: Include question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-100309@lists.php.net to get a copy of this message
You're right, that wouldn't prove my point. However, you might try a little piece of code like the following: <? $a="foo"; $b="bar"; $c="foobar"; if ($a=="foo") { include($b."php"); } else { include($c."php"); } ?> I hope this proves that includes are included at runtime because PHP wouldn't know what $b and $c are beforehand. Apart from that, I'm positive I read about it in a man page, but can't recall which, that's why I didn't direct you to it ;-) Bogdan John Holmes wrote:
The global var wouldn't work. Even if both are loaded into memory before the script is ran, only one include will actually be executed along with the code, so only one would end up affecting a global var either way. What I'm looking at is if each include .html file is 50K, am I loading 100K into memory and then running the script, or running the script and only loading the appropriate 50K into memory when it's needed? ---John Holmes...
-----Original Message----- From: Bogdan Stancescu [mailto:mgv@fx.ro] Sent: Saturday, June 01, 2002 11:12 PM To: holmes072000@charter.net Cc: php-general@lists.php.net Subject: Re: [PHP] Include question Your second guess. But you could've tested it easily with two includes appending stuff to the same global var. Bogdan John Holmes wrote:
Hi. When I've got code like the following: if($this) { include("this.html"); } elseif($that) { include("that.html"); } When are the includes() evaluated? Does the Zend engine do the
     
includes
first, pull in all of the code, then process it and produce output.
     
Or
does the engine start processing the code and only load the includes when it gets to them? Thanks for any explanations. ---John Holmes.
     


« previous php.general (#100309) next »