ID: 41088 Updated by: [EMAIL PROTECTED] Reported By: barryd dot it at gmail dot com -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: Irrelevent PHP Version: 5.2.1 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php A function has another execution scope. Previous Comments: ------------------------------------------------------------------------ [2007-04-14 23:08:49] barryd dot it at gmail dot com Description: ------------ Ok, I can not perform a break(); by using a $var = create_function('', 'break;'); outside of loop(s). In comparision, I am able to define a variable with the value 'Hello World', and use that variable anywhere within the global script bounderies. That being said and done, the following should be possible... Reproduce code: --------------- <?php $func = create_function('', 'break;'); while(1) { sleep(1); while(1) { $func(); } echo 'hello world' . "\n"; } exit(); ?> Expected result: ---------------- I would expect the result would be a continuous return of Hello world w/ a line break. Now, I understand the first person too respond will say "...the break is resulting not within the boundries of an actual loop...". If you were to have it do echo "this is a break"; ... then the code should not actually be executing, but instead defining its self to a variable, to be used later on in the script. Actual result: -------------- PHP Fatal error: Cannot break/continue 1 level in /home/barryd/Projects/PHP/phpMini/test.php(2) : runtime-created function on line 1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41088&edit=1
