ID: 11389
Updated by: venaas
Reported By: [EMAIL PROTECTED]
Status: Critical
Bug Type: Arrays related
Operating System: W98
PHP Version: 4.0.6
New Comment:

Yes, what happens is that array_walk tries to move
forward to the next element by calling zend_hash_move_forward_ex() which determines 
that the
hash is inconsistent and bails out. I think this
behavior is good enough. This script is asking for
trouble. It's important that people can't crash Apache,
but I don't mind if weird scripts like this misbehaves.
CVS works okay for me since PHP doesn't crash, but bails
out. For me I get the same behavior if I remove the call
by references (in array_walk call and myfunc declaration).


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

[2001-11-11 21:34:20] [EMAIL PROTECTED]

Indeed there is something odd going on:

<?php
$myarr = array(array(1,2,3), array(1,2,3), array(1,2,3));
echo "before\n";

array_walk($myarr, "myfunc");
function myfunc(&$value, $key) {
   global $myarr;
   $myarr=null;
}

echo "after\n";
?>

This script only echo's "before". 

--Jani


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

[2001-11-11 06:49:53] [EMAIL PROTECTED]

Reproduced with 4.2.0-dev (200111080300) on Windows 2000.

Array_walk seems to be pretty buggy. There were a few reports of crashes using 
array_walk, most importantly #12776.

Reopening.

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

[2001-10-21 01:44:42] [EMAIL PROTECTED]

I can not reproduce this with PHP 4.1.0RC1.
Could you please try the latest development build from
http://www.php4win.com/


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

[2001-06-23 17:31:08] [EMAIL PROTECTED]

Reproduced with 4.0.7-dev (latest CVS, Win32)

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

[2001-06-23 17:29:51] [EMAIL PROTECTED]

Reproduced with PHP 4.0.6


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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/?id=11389


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


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to