note 11597 deleted from function.require by jimw
| From: | jimw@php.net | Date: | Fri, 11 Jan 2002 21:42:57 +0000 |
| Subject: | note 11597 deleted from function.require by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-24698@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