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: ArrayIterator::count --FILE-- <?php echo "===Array===\n"; $a = array('zero..

Decoded Output download

--TEST--
SPL: ArrayIterator::count
--FILE--
<?php

echo "===Array===
";

$a = array('zero' => 0, 'one' => 1, 'two' => 2);
$it = new ArrayIterator($a);

var_dump($it->count());
foreach($it as $key => $val)
{
    echo "$key=>$val
";
    var_dump($it->count());
}
var_dump($it->count());

echo "===Object===
";

class test
{
    public $zero = 0;
    protected $pro;
    public $one = 1;
    private $pri;
    public $two = 2;
}

$o = new test;
$it = new ArrayIterator($o);

var_dump($it->count());
foreach($it as $key => $val)
{
    echo "$key=>$val
";
    var_dump($it->count());
}
var_dump($it->count());

?>
--EXPECT--
===Array===
int(3)
zero=>0
int(3)
one=>1
int(3)
two=>2
int(3)
int(3)
===Object===
int(3)
zero=>0
int(3)
one=>1
int(3)
two=>2
int(3)
int(3)

Did this file decode correctly?

Original Code

--TEST--
SPL: ArrayIterator::count
--FILE--
<?php

echo "===Array===\n";

$a = array('zero' => 0, 'one' => 1, 'two' => 2);
$it = new ArrayIterator($a);

var_dump($it->count());
foreach($it as $key => $val)
{
    echo "$key=>$val\n";
    var_dump($it->count());
}
var_dump($it->count());

echo "===Object===\n";

class test
{
    public $zero = 0;
    protected $pro;
    public $one = 1;
    private $pri;
    public $two = 2;
}

$o = new test;
$it = new ArrayIterator($o);

var_dump($it->count());
foreach($it as $key => $val)
{
    echo "$key=>$val\n";
    var_dump($it->count());
}
var_dump($it->count());

?>
--EXPECT--
===Array===
int(3)
zero=>0
int(3)
one=>1
int(3)
two=>2
int(3)
int(3)
===Object===
int(3)
zero=>0
int(3)
one=>1
int(3)
two=>2
int(3)
int(3)

Function Calls

None

Variables

$a [{'key': 'zero', 'value': 0}, {'key': 'one', 'value': 1}, {'key': 'two', 'value': 2}]

Stats

MD5 464b0b66e3f8f6b14faf103cadebb40a
Eval Count 0
Decode Time 90 ms