Bug #15105: Declaring a function twice
| From: | tapken at engter dot de | Date: | Fri, 18 Jan 2002 19:14:04 +0000 |
| Subject: | Bug #15105: Declaring a function twice | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-77461@lists.php.net to get a copy of this message | ||
From: tapken@engter.de
Operating system: Linux
PHP version: 4.1.1
PHP Bug Type: Scripting Engine problem
Bug description: Declaring a function twice
Don't know if this is a bug or a feature...
-foo.php----------------------------------------
<?php
if (!$bar) {
$bar = true;
include(__FILE__);
exit;
}
function foo() {
return true;
}
?>
-/foo.php----------------------------------------
This is a VERY simplified version of a script i'm working on. foo() should
only be declared once but PHP says:
<b>Fatal error</b>: Cannot redeclare foo() in
<b>/home/roland/tmp/foo.php</b> on line <b>7</b><br>
ok, i know how a can work around this problem... in this case just put the
rest of the file into the else-statement. But nevertheless it is an
interesting phenomen...
--
Edit bug report at: http://bugs.php.net/?id=15105&edit=1