Re: PHP 4.0 Bug #6440: cannot redeclare function
| From: | Wico de Leeuw | Date: | Wed, 30 Aug 2000 15:19:03 +0000 |
| Subject: | Re: PHP 4.0 Bug #6440: cannot redeclare function | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-31272@lists.php.net to get a copy of this message | ||
At 13:44 30-8-00 +0000, ce@beer.com wrote:
Hiya Try: <?From: ce@beer.comOperating system: Linux ApachePHP version: 4.0.2 PHP Bug Type: Scripting Engine problemBug description: cannot redeclare function this is test.php file <? for ($cnt = 0; $cnt<5; ++$cnt){require("test.inc.php");a($cnt);} echo "ok"; ?>
require("test.inc.php");
for ($cnt = 0; $cnt<5; ++$cnt) {
a($cnt);
}
echo "ok";?> I think this is how you want... Btw this has never worked the way you made you script Greetz, Wico
-----------
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
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
For additional commands, e-mail: php-dev-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net