ID: 31720 Updated by: [EMAIL PROTECTED] Reported By: a at b dot c dot de -Status: Open +Status: Closed Bug Type: Reproducible crash Operating System: Windows XP PHP Version: 5.0.3 New Comment:
This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2005-01-28 00:27:47] a at b dot c dot de I guess I could point out that when I found this I was trying to find some way to call a certain method of each of the array's elements, i.e. call $child->show() for each $child in $children. If there's a way to do this with array_walk() that doesn't involve additional wrapper functions then it eludes me. ------------------------------------------------------------------------ [2005-01-27 13:06:45] a at b dot c dot de Description: ------------ Using array_walk will crash PHP if a method of an uninstantiated object variable is used in the callback method. Other functions that take variables (at least, usort(), array_map(), array_reduce()) error out instead. There has to be at least one element in the array being walked. Reproduce code: --------------- $array = array('at least one element'); array_walk($array, array($nonesuchvar,'show')); Expected result: ---------------- PHP 4.3.10's error message for this situation reads: Warning: array_walk(): Unable to call Array() - function does not exist in ... while PHP 5.0.3 also reports a Notice-level message that $nonesuchvar is undefined. Actual result: -------------- A Notice-level message that $nonesuchvar is undefined, then a Windows core dump. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31720&edit=1