File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
pcre /
tests /
bug37911.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:47:59 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 #37911 (preg_replace_callback ignores named groups)
--FILE--
<?php
function callback($match)
{
var_dump($match);
return $match[1].'/'.strlen($match['name']);
}
var_dump(preg_replace_callback('|(?P<name>blub)|', 'callback', 'bla blub blah'));
var_dump(preg_match('|(?P<name>blub)|', 'bla blub blah', $m));
var_dump($m);
var_dump(preg_replace_callback('|(?P<1>blub)|', 'callback', 'bla blub blah'));
?>
--EXPECTF--
array(3) {
[0]=>
string(4) "blub"
["name"]=>
string(4) "blub"
[1]=>
string(4) "blub"
}
string(15) "bla blub/4 blah"
int(1)
array(3) {
[0]=>
string(4) "blub"
["name"]=>
string(4) "blub"
[1]=>
string(4) "blub"
}
Warning: preg_replace_callback(): Numeric named subpatterns are not allowed in %sbug37911.php on line 14
NULL
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>