summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNuno Lopes <nlopess@php.net>2006-12-08 12:13:23 +0000
committerNuno Lopes <nlopess@php.net>2006-12-08 12:13:23 +0000
commit802e12674eccee28254f1df3fd8d9fdc0f0a495b (patch)
tree2ff47dd855914d0bf946280325a326c415010020 /ext
parentfeba2edba2e0925bd3ada626beedeed229ebc6c9 (diff)
downloadphp-git-802e12674eccee28254f1df3fd8d9fdc0f0a495b.tar.gz
add tests for old bug reports
Diffstat (limited to 'ext')
-rw-r--r--ext/pcre/tests/bug21758.phpt26
-rw-r--r--ext/pcre/tests/bug27011.phpt13
-rw-r--r--ext/pcre/tests/bug38600.phpt14
3 files changed, 53 insertions, 0 deletions
diff --git a/ext/pcre/tests/bug21758.phpt b/ext/pcre/tests/bug21758.phpt
new file mode 100644
index 0000000000..2479087a62
--- /dev/null
+++ b/ext/pcre/tests/bug21758.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Bug #27011: preg_replace_callback() not working with class methods
+--FILE--
+<?php
+ class Foo {
+ function foo() {
+
+ $s = 'preg_replace() is broken';
+
+ var_dump(preg_replace_callback(
+ '/broken/',
+ array(&$this, 'bar'),
+ $s
+ ));
+ }
+
+ function bar() {
+ return 'working';
+ }
+
+ } // of Foo
+
+ $o = new Foo;
+?>
+--EXPECT--
+string(25) "preg_replace() is working"
diff --git a/ext/pcre/tests/bug27011.phpt b/ext/pcre/tests/bug27011.phpt
new file mode 100644
index 0000000000..9a2434f064
--- /dev/null
+++ b/ext/pcre/tests/bug27011.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #27011: segfault in preg_match_all()
+--FILE--
+<?php
+
+var_dump(preg_match_all('|(\w+)://([^\s"<]*[\w+#?/&=])|', "This is a text string", $matches, PREG_SET_ORDER));
+var_dump($matches);
+
+?>
+--EXPECT--
+int(0)
+array(0) {
+}
diff --git a/ext/pcre/tests/bug38600.phpt b/ext/pcre/tests/bug38600.phpt
new file mode 100644
index 0000000000..8e1f78c0e3
--- /dev/null
+++ b/ext/pcre/tests/bug38600.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #38600: infinite loop in pcre with extended class
+--FILE--
+<?php
+$foo = 'bla bla bla';
+
+var_dump(preg_match('/(?<!\w)(0x[\p{N}]+[lL]?|[\p{Nd}]+(e[\p{Nd}]*)?[lLdDfF]?)(?!\w)/', $foo, $m));
+var_dump($m);
+
+?>
+--EXPECT--
+int(0)
+array(0) {
+}