ID: 13568 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: * PHP Version: 4.10 New Comment:
Documentation at http://www.php.net/manual/en/functions.php updted. "Why conditional functions don't immediately exist." Previous Comments: ------------------------------------------------------------------------ [2002-09-09 08:14:10] [EMAIL PROTECTED] the new semantics that allows calling functions prior to their definition only works for functions defined in a global scope as soon as a function definition is within a conditional block or nested within another function the new function cannot be created at parse time as it is not known yet wether the condition will be met or the surrounding function ever called, so these functions are created at runtime instead when execution reaches this part of the code so it is rather obvious that you can't call such a function ahead of it's definition well, maybe not *that* obvious, reclassified as documentation problem ... ------------------------------------------------------------------------ [2001-12-14 14:01:10] [EMAIL PROTECTED] Parhaps, ZE2 should depreciate this syntax. I really want BNF for PHP. ------------------------------------------------------------------------ [2001-10-05 14:56:31] [EMAIL PROTECTED] container (); a script to reproduce the error quickly. function container () { function nested_php3 () { echo "this will be output"; } nested_php3 (); nested_php4 (); function nested_php4 () { echo "this won't be output"; } } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=13568&edit=1 -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
