ID: 37797
User updated by: whitephoenix at mail dot ru
Reported By: whitephoenix at mail dot ru
Status: Open
Bug Type: *General Issues
Operating System: tested on WinXP
PHP Version: 5.1.4
New Comment:
And if to run it, several times, then, in string "lambda_X", X will be
incremented.
Previous Comments:
------------------------------------------------------------------------
[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