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: RecursiveIteratorIterator - Test where the case is RS_SELF and mode is CHILD..

Decoded Output download

--TEST--
SPL: RecursiveIteratorIterator - Test where the case is RS_SELF and mode is CHILD_FIRST
--FILE--
<?php

$arr = array(array(1,2),2);
$arrOb = new ArrayObject($arr);

$recArrIt = new RecursiveArrayIterator($arrOb->getIterator());

class MyRecursiveIteratorIterator extends RecursiveIteratorIterator {

    function nextelement(): void {
        echo __METHOD__."
";
    }
}


$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::CHILD_FIRST);

foreach ($recItIt as $key => $val) echo "$key
";

?>
--EXPECT--
MyRecursiveIteratorIterator::nextelement
0
MyRecursiveIteratorIterator::nextelement
1
MyRecursiveIteratorIterator::nextelement
0
MyRecursiveIteratorIterator::nextelement
1

Did this file decode correctly?

Original Code

--TEST--
SPL: RecursiveIteratorIterator - Test where the case is RS_SELF and mode is CHILD_FIRST
--FILE--
<?php

$arr = array(array(1,2),2);
$arrOb = new ArrayObject($arr);

$recArrIt = new RecursiveArrayIterator($arrOb->getIterator());

class MyRecursiveIteratorIterator extends RecursiveIteratorIterator {

    function nextelement(): void {
        echo __METHOD__."\n";
    }
}


$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::CHILD_FIRST);

foreach ($recItIt as $key => $val) echo "$key\n";

?>
--EXPECT--
MyRecursiveIteratorIterator::nextelement
0
MyRecursiveIteratorIterator::nextelement
1
MyRecursiveIteratorIterator::nextelement
0
MyRecursiveIteratorIterator::nextelement
1

Function Calls

None

Variables

None

Stats

MD5 ba88c44c9c59197bec83b6671352636e
Eval Count 0
Decode Time 107 ms