Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Bug #61967: unset array item in array_walk_recursive cause inconsistent array --F..

Decoded Output download

--TEST--
Bug #61967: unset array item in array_walk_recursive cause inconsistent array
--FILE--
<?php
$arr = array(
    range(1, 5),
    range(1, 5),
    range(1, 5),
    range(1, 5),
    range(1, 5),
);

array_walk_recursive($arr,
    function (&$value, $key) use(&$arr) {
        var_dump($key);
        unset($arr[$key]);
    }
);
?>
--EXPECT--
int(0)
int(1)
int(2)
int(3)
int(4)

Did this file decode correctly?

Original Code

--TEST--
Bug #61967: unset array item in array_walk_recursive cause inconsistent array
--FILE--
<?php
$arr = array(
    range(1, 5),
    range(1, 5),
    range(1, 5),
    range(1, 5),
    range(1, 5),
);

array_walk_recursive($arr,
    function (&$value, $key) use(&$arr) {
        var_dump($key);
        unset($arr[$key]);
    }
);
?>
--EXPECT--
int(0)
int(1)
int(2)
int(3)
int(4)

Function Calls

range 1

Variables

None

Stats

MD5 c35bb38263e45d95e1bfad458d7cb33c
Eval Count 0
Decode Time 98 ms