|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-03-26 12:57 UTC] madams at morcor dot com
Description: ------------ array_walk causes PHP to crash on Windows 2000/2003 server when called recursively. Reproduce code: --------------- Please see http://staff.morcor.com/~madams/tmp/bugs.php.net/2004-03-26.array_walk_bug.phps for the source that causes PHP on Windows 2000/2003 server crash. The script also attempts to load an xml file. An example XML file is located at http://staff.morcor.com/~madams/tmp/bugs.php/net/2004-03-26.configuration.xml Script depends on PEAR.php and PEAR Config.php Expected result: ---------------- This code should parse the array created by PEAR::Config and define a constant for every value in the array that is not a) an array itself, b) an array with a key of '@' or c) an array that does not have an attribute (sub-array '@') constant marked 'FALSE'. Actual result: -------------- Script runs partially, stops and fails to terminate properly. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 02:00:01 2025 UTC |
I'd guess it has to do with FreeBSD == 'Good'. Fortunately, there is a solution. One just needs to create your own array_walk function (yes, PHP allows you to write functions!): function array_walk_r(&$array, $function, $data = null) { foreach ($array as $key => $value) { call_user_func_array($function, array($value, $key, $data)); $array[$key] = $value; } } // end func array_walk_r It's too bad the PHP folks can't support us more functional-minded folks.