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 #21998 (array_pop() does not reset the current array position) --FILE-- <?php..

Decoded Output download

--TEST--
Bug #21998 (array_pop() does not reset the current array position)
--FILE--
<?php

$a = array("a", "b", "c");

var_dump(key($a));
var_dump(array_pop($a));
var_dump(key($a));
var_dump(array_pop($a));
var_dump(key($a));
var_dump(array_pop($a));
var_dump(key($a));

?>
--EXPECT--
int(0)
string(1) "c"
int(0)
string(1) "b"
int(0)
string(1) "a"
NULL

Did this file decode correctly?

Original Code

--TEST--
Bug #21998 (array_pop() does not reset the current array position)
--FILE--
<?php

$a = array("a", "b", "c");

var_dump(key($a));
var_dump(array_pop($a));
var_dump(key($a));
var_dump(array_pop($a));
var_dump(key($a));
var_dump(array_pop($a));
var_dump(key($a));

?>
--EXPECT--
int(0)
string(1) "c"
int(0)
string(1) "b"
int(0)
string(1) "a"
NULL

Function Calls

key 1

Variables

$a [{'key': 0, 'value': 'a'}, {'key': 1, 'value': 'b'}, {'key': 2, 'value': 'c'}]

Stats

MD5 e664a2eee9e6f7cc52850280a600591c
Eval Count 0
Decode Time 81 ms