From:
Operating system: Linux
PHP version: 5.3.3
Package: Arrays related
Bug Type: Bug
Bug description:array_walk_recursive crashes if third param of the function is
by reference
Description:
------------
This is something that changed between PHP 5.3.2 and PHP 5.3.3.
array_walk_recursive accepts a 3rd parameter for 'userdata'.
If:
- this parameter is an object AND
- the user-created function used as second parameter to
array_walk_recursive defines the third parameter by reference AND
- The array given as first parameter to array_walk_recursive is a
multi-dimensional array,
PHP crashes.
Test script:
---------------
$array = array('foo', 'bar' => array('taz'));
$foo = new stdClass();
array_walk_recursive($array, create_function('&$v, $k, &$u', ''), $foo);
echo 'No crash';
//This one works: array_walk_recursive($array, create_function('&$v, $k,
$u', ''), $foo);
Expected result:
----------------
No Crash
Actual result:
--------------
PHP crashes
--
Edit bug report at http://bugs.php.net/bug.php?id=52719&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52719&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52719&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=52719&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52719&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=52719&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52719&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=52719&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=52719&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=52719&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=52719&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=52719&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=52719&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=52719&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52719&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52719&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52719&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=52719&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=52719&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=52719&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=52719&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=52719&r=mysqlcfg