PHP 4.0 Bug #6440: cannot redeclare function

From: Date: Wed, 30 Aug 2000 13:44:01 +0000
Subject: PHP 4.0 Bug #6440: cannot redeclare function
Groups: php.dev 
Request: Send a blank email to php-dev+get-31250@lists.php.net to get a copy of this message
From: ce@beer.com Operating system: Linux Apache PHP version: 4.0.2 PHP Bug Type: Scripting Engine problem Bug description: cannot redeclare function this is test.php file <? for ($cnt = 0; $cnt<5; ++$cnt){ require("test.inc.php"); a($cnt); } echo "ok"; ?> ----------- and here is <? function a($cnt){ echo $cnt; return; } ?> ---- the result is 0 Fatal error: Cannot redeclare a() in Unknown on line 3 ------- it is not necessary a bug since if the require is replaced by the code itself it gives the same error. But why the behavior is changed, in previous versions it works

« previous php.dev (#31250) next »