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-- Bug #54304 (Setting replacement value for RegexIterator doesn't work) --FILE-- <?..

Decoded Output download

--TEST--
Bug #54304 (Setting replacement value for RegexIterator doesn't work)
--FILE--
<?php
class foo extends ArrayIterator {
    public function __construct( ) {
        parent::__construct(array(
            'test3'=>'test999'));
    }
}

$h = new foo;
$i = new RegexIterator($h, '/^test(.*)/', RegexIterator::REPLACE);
$i->replacement = "42";
var_dump($i->replacement);
foreach ($i as $name=>$value) {
    var_dump($name, $value);
}
var_dump($i->replacement);
?>
--EXPECT--
string(2) "42"
string(5) "test3"
string(2) "42"
string(2) "42"

Did this file decode correctly?

Original Code

--TEST--
Bug #54304 (Setting replacement value for RegexIterator doesn't work)
--FILE--
<?php
class foo extends ArrayIterator {
    public function __construct( ) {
        parent::__construct(array(
            'test3'=>'test999'));
    }
}

$h = new foo;
$i = new RegexIterator($h, '/^test(.*)/', RegexIterator::REPLACE);
$i->replacement = "42";
var_dump($i->replacement);
foreach ($i as $name=>$value) {
    var_dump($name, $value);
}
var_dump($i->replacement);
?>
--EXPECT--
string(2) "42"
string(5) "test3"
string(2) "42"
string(2) "42"

Function Calls

None

Variables

None

Stats

MD5 5bc2b1c00517a5c1dbfdb1f0512154d8
Eval Count 0
Decode Time 125 ms