note 11597 added to require

From: Date: Mon, 26 Feb 2001 20:28:38 +0000
Subject: note 11597 added to require
Groups: php.notes 
Request: Send a blank email to php-notes+get-11617@lists.php.net to get a copy of this message
Each included or required file must be a completely valid script in itself. So, you can not start a function in one file and then close it in another. For example, the following is NOT valid. === file1.php === <?php function Test() { include('./file2.php'); ?> === file2.php === <?php echo 'Hi!'; } # end function Test() ?> ================= This used to work in PHP 3 but does not work in PHP 4. Exactly why this change was made, I don't know. All I do know is that I wish it was not changed. For a tad more info, see http://bugs.php.net/bugs.php?id=9467 http://www.php.net/manual/en/function.require.php

« previous php.notes (#11617) next »