2009-01-28 22:40:36 +00:00
|
|
|
--TEST--
|
|
|
|
Bug #47229 (preg_quote() doesn't escape -)
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
var_dump(preg_quote('-oh really?'));
|
|
|
|
|
|
|
|
// make sure there's no regression in matching
|
|
|
|
preg_match('/[a\-c]+/', 'a---b', $m);
|
|
|
|
var_dump($m);
|
|
|
|
|
|
|
|
preg_match('/[a\-c]+/', 'a\-', $m);
|
|
|
|
var_dump($m);
|
|
|
|
|
|
|
|
preg_match("/a\-{2,}/", 'a----a', $m);
|
|
|
|
var_dump($m);
|
|
|
|
|
|
|
|
preg_match("/a\-{1,}/", 'a\----a', $m);
|
|
|
|
var_dump($m);
|
|
|
|
|
|
|
|
?>
|
2009-04-24 15:52:38 +00:00
|
|
|
--EXPECTF--
|
|
|
|
%string|unicode%(13) "\-oh really\?"
|
2009-01-28 22:40:36 +00:00
|
|
|
array(1) {
|
|
|
|
[0]=>
|
2009-04-24 15:52:38 +00:00
|
|
|
%string|unicode%(4) "a---"
|
2009-01-28 22:40:36 +00:00
|
|
|
}
|
|
|
|
array(1) {
|
|
|
|
[0]=>
|
2009-04-24 15:52:38 +00:00
|
|
|
%string|unicode%(1) "a"
|
2009-01-28 22:40:36 +00:00
|
|
|
}
|
|
|
|
array(1) {
|
|
|
|
[0]=>
|
2009-04-24 15:52:38 +00:00
|
|
|
%string|unicode%(5) "a----"
|
2009-01-28 22:40:36 +00:00
|
|
|
}
|
|
|
|
array(0) {
|
|
|
|
}
|