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: Iterator: Overloaded object and destruction --FILE-- <?php class Test imple..

Decoded Output download

--TEST--
SPL: Iterator: Overloaded object and destruction
--FILE--
<?php

class Test implements Iterator {
    function foo() {
        echo __METHOD__ . "()
";
    }
    function rewind(): void {}
    function valid(): bool {}
    function current(): mixed {}
    function key(): mixed {}
    function next(): void {}
}

class TestIteratorIterator extends IteratorIterator {
    function __destruct() {
        echo __METHOD__ . "()
";
        $this->foo();
    }
}

$obj = new TestIteratorIterator(new Test);
$obj->foo();
unset($obj);

?>
--EXPECT--
Test::foo()
TestIteratorIterator::__destruct()
Test::foo()

Did this file decode correctly?

Original Code

--TEST--
SPL: Iterator: Overloaded object and destruction
--FILE--
<?php

class Test implements Iterator {
    function foo() {
        echo __METHOD__ . "()\n";
    }
    function rewind(): void {}
    function valid(): bool {}
    function current(): mixed {}
    function key(): mixed {}
    function next(): void {}
}

class TestIteratorIterator extends IteratorIterator {
    function __destruct() {
        echo __METHOD__ . "()\n";
        $this->foo();
    }
}

$obj = new TestIteratorIterator(new Test);
$obj->foo();
unset($obj);

?>
--EXPECT--
Test::foo()
TestIteratorIterator::__destruct()
Test::foo()

Function Calls

None

Variables

None

Stats

MD5 424a1e4f1eac1d15a0b317390afeb9d7
Eval Count 0
Decode Time 101 ms