From:             [EMAIL PROTECTED]
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


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to