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: RegexIterator --FILE-- <?php $ar = array(0, "123", 123, 22 => "abc", "a2b",..

Decoded Output download

--TEST--
SPL: RegexIterator
--FILE--
<?php

$ar = array(0, "123", 123, 22 => "abc", "a2b", 22, "a2d" => 7, 42);

foreach(new RegexIterator(new ArrayIterator($ar), "/2/") as $k => $v)
{
    echo "$k=>$v
";
}

?>
===KEY===
<?php

foreach(new RegexIterator(new ArrayIterator($ar), "/2/", 0, RegexIterator::USE_KEY) as $k => $v)
{
    echo "$k=>$v
";
}

?>
--EXPECT--
1=>123
2=>123
23=>a2b
24=>22
25=>42
===KEY===
2=>123
22=>abc
23=>a2b
24=>22
a2d=>7
25=>42

Did this file decode correctly?

Original Code

--TEST--
SPL: RegexIterator
--FILE--
<?php

$ar = array(0, "123", 123, 22 => "abc", "a2b", 22, "a2d" => 7, 42);

foreach(new RegexIterator(new ArrayIterator($ar), "/2/") as $k => $v)
{
    echo "$k=>$v\n";
}

?>
===KEY===
<?php

foreach(new RegexIterator(new ArrayIterator($ar), "/2/", 0, RegexIterator::USE_KEY) as $k => $v)
{
    echo "$k=>$v\n";
}

?>
--EXPECT--
1=>123
2=>123
23=>a2b
24=>22
25=>42
===KEY===
2=>123
22=>abc
23=>a2b
24=>22
a2d=>7
25=>42

Function Calls

None

Variables

$ar [{'key': 0, 'value': 0}, {'key': 1, 'value': '123'}, {'key': 2, 'value': 123}, {'key': 22, 'value': 'abc'}, {'key': 4, 'value': 'a2b'}, {'key': 5, 'value': 22}, {'key': 'a2d', 'value': 7}, {'key': 7, 'value': 42}]

Stats

MD5 94e670a250dd40c6132528244e6a35fe
Eval Count 0
Decode Time 119 ms