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-- SimpleXML: overridden count() method --EXTENSIONS-- simplexml --FILE-- <?php clas..

Decoded Output download

--TEST--
SimpleXML: overridden count() method
--EXTENSIONS--
simplexml
--FILE--
<?php
class SXE extends SimpleXmlElement {
    public function count(): int {
        echo "Called Count!
";
        return parent::count();
    }
}

$str = '<xml><c>asdf</c><c>ghjk</c></xml>';
$sxe = new SXE($str);
var_dump(count($sxe));
?>
--EXPECT--
Called Count!
int(2)

Did this file decode correctly?

Original Code

--TEST--
SimpleXML: overridden count() method
--EXTENSIONS--
simplexml
--FILE--
<?php
class SXE extends SimpleXmlElement {
    public function count(): int {
        echo "Called Count!\n";
        return parent::count();
    }
}

$str = '<xml><c>asdf</c><c>ghjk</c></xml>';
$sxe = new SXE($str);
var_dump(count($sxe));
?>
--EXPECT--
Called Count!
int(2)

Function Calls

None

Variables

None

Stats

MD5 8c872d9eb0fd88a9fdbdf12d00b8df69
Eval Count 0
Decode Time 88 ms