summaryrefslogtreecommitdiff
path: root/ext/spl/tests/bug54304.phpt
blob: 32cbe486a05115045a0865a0c759bdc40c61bcab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--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--
int(42)
string(5) "test3"
string(2) "42"
int(42)