#37797 [NEW]: Lambda unexpected string

From: Date: Wed, 14 Jun 2006 01:54:47 +0000
Subject: #37797 [NEW]: Lambda unexpected string
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-98335@lists.php.net to get a copy of this message
From: whitephoenix at mail dot ru Operating system: tested on WinXP PHP version: 5.1.4 PHP Bug Type: *General Issues Bug description: Lambda unexpected string 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 bug report at http://bugs.php.net/?id=37797&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37797&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37797&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37797&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37797&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37797&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37797&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37797&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37797&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37797&r=support Expected behavior: http://bugs.php.net/fix.php?id=37797&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37797&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37797&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37797&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37797&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37797&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37797&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37797&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37797&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37797&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37797&r=mysqlcfg

« previous php.bugs (#98335) next »