ID:               32984
 Updated by:       [EMAIL PROTECTED]
 Reported By:      arne dot binder at blue-com dot de
-Status:           Open
+Status:           Feedback
 Bug Type:         Reproducible crash
 Operating System: Windows NT4
 PHP Version:      5.0.4
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip

Works fine for me.




Previous Comments:
------------------------------------------------------------------------

[2005-05-09 13:07:51] arne dot binder at blue-com dot de

Description:
------------
The problem is the location of the declaration of the used
callback-function in array_walk(). If this declaration is inside a
switch-block (but if-blocks work!), array_walk() crashes php.

The following sample-code illustrates the problem. If the function
declaration is moved out of the switch-block, everything works fine.

Reproduce code:
---------------
<?
$cond = 1;

switch ($cond) {
case 1:
        $arr = array('Line' => ' 1');

        print_r($arr);

        function trim_it(&$item, $key) { $item=trim($item); }

        array_walk($arr, 'trim_it');

        print_r($arr);
        break;
}
?>

Expected result:
----------------
Array
(
    [Line] =>  1
)
Array
(
    [Line] => 1
)


Actual result:
--------------
Ask Dr. Watson for NT4 ;-)


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=32984&edit=1

Reply via email to