|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-05-31 09:42 UTC] stas at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 08:00:01 2025 UTC |
The following worked in PHP3, but does not work in PHP4. There are three files, the first 'test.php' includes the other two 'test1.php' and 'test2.php'. test.php: <?php include('test1.php'); include('test2.php'); ?> test1.php: <?php $myvar = 1; if ($myvar) { ?> test2.php: <html><body>mynum = 1</body></html> <?php } else { ?> <html><body>mynum = 0</body> </html> <?php } ?> Error messages with using include(): Parse error: parse error in test1.php on line 4 Parse error: parse error in test2.php on line 8 Error messages with using require(): Parse error: parse error in test1.php on line 4 Configure parameters: % ./configure --enable-track-vars --with-apxs=/usr/local/apache/1.3/bin/apxs --with-mysql --enable-trans-sid --enable-versioning The documentation indicates that include() and require() will treat the included file as if it were part of the main file. I believe having if() work across included files is an important capability. Christopher Thompson