File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
spl /
tests /
bug50579.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:01 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
Bug #50579 (RegexIterator::REPLACE doesn't work)
--FILE--
<?php
class foo extends ArrayIterator {
public function __construct( ) {
parent::__construct(array(
'test1'=>'test888',
'test2'=>'what?',
'test3'=>'test999'));
}
}
$h = new foo;
$i = new RegexIterator($h, '/^test(.*)/', RegexIterator::REPLACE);
$i->replacement = '[$0]';
foreach ($i as $name=>$value) {
echo $name . '=>' . $value . "\n";
}
$i->replacement = '$1';
foreach ($i as $name=>$value) {
echo $name . '=>' . $value . "\n";
}
$h = new foo;
$i = new RegexIterator($h, '/^test(.*)/', RegexIterator::REPLACE);
$i->replacement = '[$1]';
foreach ($i as $name=>$value) {
echo $name . '=>' . $value . "\n";
}
?>
--EXPECTF--
test1=>[test888]
test3=>[test999]
test1=>888
test3=>999
test1=>[888]
test3=>[999]
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>