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-- SPL: CachingIterator::hasNext() --FILE-- <?php $ar = array(1, 2, array(31, 32, a..

Decoded Output download

--TEST--
SPL: CachingIterator::hasNext()
--FILE--
<?php

$ar = array(1, 2, array(31, 32, array(331)), 4);

$it = new RecursiveArrayIterator($ar);
$it = new RecursiveCachingIterator($it);
$it = new RecursiveIteratorIterator($it);

foreach($it as $k=>$v)
{
    echo "$k=>$v
";
    echo "hasNext: " . ($it->getInnerIterator()->hasNext() ? "yes" : "no") . "
";
}

?>
--EXPECTF--
0=>1
hasNext: yes
1=>2
hasNext: yes

Warning: Array to string conversion in %s on line %d
0=>31
hasNext: yes
1=>32
hasNext: yes

Warning: Array to string conversion in %s on line %d
0=>331
hasNext: no
3=>4
hasNext: no

Did this file decode correctly?

Original Code

--TEST--
SPL: CachingIterator::hasNext()
--FILE--
<?php

$ar = array(1, 2, array(31, 32, array(331)), 4);

$it = new RecursiveArrayIterator($ar);
$it = new RecursiveCachingIterator($it);
$it = new RecursiveIteratorIterator($it);

foreach($it as $k=>$v)
{
    echo "$k=>$v\n";
    echo "hasNext: " . ($it->getInnerIterator()->hasNext() ? "yes" : "no") . "\n";
}

?>
--EXPECTF--
0=>1
hasNext: yes
1=>2
hasNext: yes

Warning: Array to string conversion in %s on line %d
0=>31
hasNext: yes
1=>32
hasNext: yes

Warning: Array to string conversion in %s on line %d
0=>331
hasNext: no
3=>4
hasNext: no

Function Calls

None

Variables

$ar [{'key': 0, 'value': 1}, {'key': 1, 'value': 2}, {'key': 2, 'value': [{'key': 0, 'value': 31}, {'key': 1, 'value': 32}, {'key': 2, 'value': [{'key': 0, 'value': 331}]}]}, {'key': 3, 'value': 4}]

Stats

MD5 29290764f7706341f0f33d7af78cafbb
Eval Count 0
Decode Time 98 ms