ID: 37797 Updated by: [EMAIL PROTECTED] Reported By: whitephoenix at mail dot ru -Status: Open +Status: Bogus Bug Type: *General Issues Operating System: tested on WinXP PHP Version: 5.1.4 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 That's how lambda functions work in PHP.... Previous Comments: ------------------------------------------------------------------------ [2006-06-14 01:59:50] whitephoenix at mail dot ru And if to run it, several times, then, in string "lambda_X", X will be incremented. ------------------------------------------------------------------------ [2006-06-14 01:54:46] whitephoenix at mail dot ru Description: ------------ Its seems, PHP should show error with type E_WARNING. If it's wrong, then i think, NUL-byte is unexpected there. Reproduce code: --------------- <?php // ASCII in hex function show_callback($m) {return '['.dechex(ord($m[0])).']';} function show($result) {echo preg_replace_callback('~\W~','show_callback',$result)."\n";} // Execution for ($i = 0; $i < 5; $i++) { $callback = create_function('$php','undefined();'); $string = substr($callback,0); // or other function, for example, strval() or str_replace()... show($string); } ?> Expected result: ---------------- It seems, PHP should show error with type E_WARNING. If it's wrong, then I think, NUL-byte is unexpected there. Sorry for my English, I know, it's difficult to read. Thanks! Actual result: -------------- [0]lambda_35 [0]lambda_36 [0]lambda_37 [0]lambda_38 [0]lambda_39 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37797&edit=1