]> granicus.if.org Git - php/commitdiff
Tests for bug #61165
authorXinchen Hui <laruence@php.net>
Sat, 25 Feb 2012 03:12:54 +0000 (03:12 +0000)
committerXinchen Hui <laruence@php.net>
Sat, 25 Feb 2012 03:12:54 +0000 (03:12 +0000)
Zend/tests/bug61165.phpt [new file with mode: 0644]

diff --git a/Zend/tests/bug61165.phpt b/Zend/tests/bug61165.phpt
new file mode 100644 (file)
index 0000000..def2203
--- /dev/null
@@ -0,0 +1,30 @@
+--TEST--
+Bug #61165 (Segfault - strip_tags())
+--XFAILD--
+#61165 doesn't fix yet
+--FILE--
+<?php
+
+$handler = NULL;
+class T {
+    public $_this;
+
+    public function __toString() {
+               global $handler;
+           $handler = $this;
+        $this->_this = $this; // <-- uncoment this
+        return 'A';
+    }
+}
+
+$t = new T;
+for ($i = 0; $i < 3; $i++) {
+    strip_tags($t);
+       strip_tags(new T);
+    echo "$i\n";
+}
+--EXPECTF--
+object(T)#%d (1) {
+  ["_this"]=>
+  *RECURSION*
+}