Re: Include file must be valid

From: Date: Fri, 28 Jul 2000 17:36:15 +0000
Subject: Re: Include file must be valid
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-8825@lists.php.net to get a copy of this message
But this issure is not really helpful for developers. The documentation says, that include just pulls the content of the file into the other file. I don't want that file to be evaluated for itself. The example I gave, is a help for people who don't understand how to create a while structure but want to use it. Instead of writing while ($output[something][$i]) { or even something more complex, they just have to write include(whilestart) What other possibility do I have to solve this problem? Thanks for answer Simon >That's true. It's an issue which should be documented - it's not a bug. > >Zeev On Fri, 28 Jul 2000, Simon Biela wrote: > Hi there! > > I just migrated from PHP3 to 4. In 3 it was possible to include a file which > wasn't really valid, for example with an opened while statement, which was > then closed in another include file. > > It seems, that in PHP4 the code in an include file must be completely valid. > > here's an example > > file1.php > $i = 0; while($something[$i]) { > > file2.php > $i++; } > > file3.php > include (file1.php); > echo $i > include (file2.php); > > > --- > netdienste GbR > internet & multimedia > Geisselstrasse 19 > 50823 Koeln > > tel: +49 221 - 932 958 2 > fax: +49 221 - 932 958 5 > > s.biela@netdienste.de > http://www.netdienste.de > > red:pepper - das redaktionssystem > www.redpepper.netdienste.de > > > > > > -- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.general (#8825) next »