|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-10-09 13:09 UTC] brianm at dealnews dot com
We have been using code like this for a long time:
test.php:
<?php
include "test2.php";
include "test3.php";
foo();
bar();
?>
test2.php:
<?php
if(defined("_TEST2")) return;
define("_TEST2", true);
function foo(){
echo "foo\n";
}
?>
test3.php
<?php
if(defined("_TEST3")) return;
define("_TEST3", true);
include "test2.php";
function bar(){
echo "bar\n";
}
?>
With 4.0.6 we get:
-------------------
$ php test.php
X-Powered-By: PHP/4.0.6RC4
Content-type: text/html
foo
bar
With current dev we get:
------------------------
$ ./php test.php
X-Powered-By: PHP/4.0.8-dev
Content-type: text/html
Fatal error: Cannot redeclare foo() (previously declared in /home/brianm/test2.php:6) in /home/brianm/test2.php on line 7
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 22 20:00:01 2025 UTC |
Example can be reduced to: test.php: <?php function foo() {} include "test2.php"; ?> test2.php: <?php return; function foo() {} ?>