|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-05-29 14:36 UTC] bjori@php.net
-Status: Open
+Status: Bogus
[2011-05-29 14:36 UTC] bjori@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 10:00:02 2025 UTC |
Description: ------------ When declaring a function inside an if/else statement, the latter declaration is honoured regardless of which branch the if/else statement took. Test script: --------------- <?php if(true) { function foo() { echo "first foo."; } } else { function foo() { echo "second foo."; } } foo(); Expected result: ---------------- first foo. OR: Syntax Error: Cannot declare function inside conditional statement Actual result: -------------- second foo.