Bug #68137 [NEW]: recursive closure gives segfault evaluating zero

From: Date: Thu, 02 Oct 2014 20:39:40 +0000
Subject: Bug #68137 [NEW]: recursive closure gives segfault evaluating zero
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187803@lists.php.net to get a copy of this message
From: leandro at leandro dot org Operating system: Fedora 19 PHP version: 5.5.17 Package: Arrays related Bug Type: Bug Bug description:recursive closure gives segfault evaluating zero Description: ------------ i don't know what is happening but i guess it can't eveluate (0 - 1) + (0 - 2) by some unknown reason when $n == 0 Test script: --------------- $wop = function($n) use ( &$wop ){ //if ($n == 0) return 1; //with this line commented, we get a segfault return $wop($n - 1) + $wop($n - 2); }; print_r( array_map($wop, range(0,20)) ); -- Edit bug report at https://bugs.php.net/bug.php?id=68137&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68137&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68137&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68137&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=68137&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=68137&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=68137&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=68137&r=needscript Try newer version: https://bugs.php.net/fix.php?id=68137&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=68137&r=support Expected behavior: https://bugs.php.net/fix.php?id=68137&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=68137&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=68137&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=68137&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68137&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=68137&r=dst IIS Stability: https://bugs.php.net/fix.php?id=68137&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=68137&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=68137&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=68137&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=68137&r=mysqlcfg

« previous php.bugs (#187803) next »