summaryrefslogtreecommitdiff
path: root/Zend/tests
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2010-10-21 08:52:46 +0200
committerOndřej Surý <ondrej@sury.org>2010-10-21 08:52:46 +0200
commit01fcdff3849c3691d9aaeaab735846ab6d8895ca (patch)
tree6460876d356113fa7053df36f2aa00baa7db24a9 /Zend/tests
parent855a09f4eded707941180c9d90acd17c25e29447 (diff)
downloadphp-upstream/5.3.3.tar.gz
Imported Upstream version 5.3.3upstream/5.3.3
Diffstat (limited to 'Zend/tests')
-rwxr-xr-xZend/tests/bug35163.phpt18
-rwxr-xr-xZend/tests/bug35163_2.phpt37
-rwxr-xr-xZend/tests/bug35163_3.phpt22
-rwxr-xr-xZend/tests/bug35239.phpt24
-rwxr-xr-xZend/tests/bug35634.phpt6
-rw-r--r--Zend/tests/bug45180.phpt6
-rw-r--r--Zend/tests/bug45186.phpt8
-rw-r--r--Zend/tests/bug45877.phpt4
-rw-r--r--Zend/tests/bug46665.phpt2
-rw-r--r--Zend/tests/bug48215.phpt2
-rw-r--r--Zend/tests/bug48215_2.phpt3
-rw-r--r--Zend/tests/bug48930.phpt16
-rw-r--r--Zend/tests/bug49893.phpt28
-rw-r--r--Zend/tests/bug50383.phpt130
-rw-r--r--Zend/tests/bug50810.phpt46
-rw-r--r--Zend/tests/bug51176.phpt32
-rw-r--r--Zend/tests/bug51394.phpt16
-rw-r--r--Zend/tests/bug51791.phpt14
-rw-r--r--Zend/tests/bug51822.phpt40
-rw-r--r--Zend/tests/bug51827.phpt19
-rw-r--r--Zend/tests/bug52001.phpt17
-rw-r--r--Zend/tests/bug52041.phpt50
-rw-r--r--Zend/tests/bug52051.phpt27
-rw-r--r--Zend/tests/bug52060.phpt12
-rw-r--r--Zend/tests/bug52160.phpt34
-rw-r--r--Zend/tests/bug52193.phpt78
-rw-r--r--Zend/tests/bug52237.phpt11
-rw-r--r--Zend/tests/call_static_003.phpt4
-rw-r--r--Zend/tests/call_static_007.phpt2
-rw-r--r--Zend/tests/closure_020.phpt13
-rw-r--r--Zend/tests/closure_034.phpt10
-rw-r--r--Zend/tests/closure_035.phpt10
-rw-r--r--Zend/tests/foreach_002.phpt5
-rw-r--r--Zend/tests/gc_004.phpt7
-rw-r--r--Zend/tests/gc_005.phpt11
-rw-r--r--Zend/tests/gc_006.phpt14
-rw-r--r--Zend/tests/gc_007.phpt7
-rw-r--r--Zend/tests/gc_008.phpt11
-rw-r--r--Zend/tests/gc_009.phpt14
-rw-r--r--Zend/tests/gc_010.phpt7
-rw-r--r--Zend/tests/gc_011.phpt11
-rw-r--r--Zend/tests/gc_012.phpt2
-rw-r--r--Zend/tests/gc_013.phpt2
-rw-r--r--Zend/tests/gc_014.phpt2
-rw-r--r--Zend/tests/gc_015.phpt2
-rw-r--r--Zend/tests/gc_016.phpt2
-rw-r--r--Zend/tests/gc_017.phpt2
-rw-r--r--Zend/tests/gc_018.phpt2
-rw-r--r--Zend/tests/gc_019.phpt2
-rw-r--r--Zend/tests/gc_020.phpt2
-rw-r--r--Zend/tests/gc_021.phpt2
-rw-r--r--Zend/tests/gc_022.phpt1
-rw-r--r--Zend/tests/gc_023.phpt2
-rw-r--r--Zend/tests/gc_024.phpt2
-rw-r--r--Zend/tests/gc_025.phpt2
-rw-r--r--Zend/tests/gc_027.phpt2
-rw-r--r--Zend/tests/gc_028.phpt2
-rw-r--r--Zend/tests/gc_029.phpt2
-rw-r--r--Zend/tests/gc_030.phpt4
-rw-r--r--Zend/tests/ns_063.phpt3
-rw-r--r--Zend/tests/objects_011.phpt3
-rw-r--r--Zend/tests/objects_020.phpt14
62 files changed, 684 insertions, 201 deletions
diff --git a/Zend/tests/bug35163.phpt b/Zend/tests/bug35163.phpt
index 4501fa937..6a10d244b 100755
--- a/Zend/tests/bug35163.phpt
+++ b/Zend/tests/bug35163.phpt
@@ -17,22 +17,8 @@ array(1) {
[0]=>
int(2)
[1]=>
- &array(3) {
- [0]=>
- int(2)
- [1]=>
- *RECURSION*
- [2]=>
- *RECURSION*
- }
+ *RECURSION*
[2]=>
- &array(3) {
- [0]=>
- int(2)
- [1]=>
- *RECURSION*
- [2]=>
- *RECURSION*
- }
+ *RECURSION*
}
}
diff --git a/Zend/tests/bug35163_2.phpt b/Zend/tests/bug35163_2.phpt
index 4adf7709a..01387204c 100755
--- a/Zend/tests/bug35163_2.phpt
+++ b/Zend/tests/bug35163_2.phpt
@@ -20,46 +20,17 @@ array(3) {
[0]=>
int(2)
[1]=>
- &array(3) {
- [0]=>
- int(2)
- [1]=>
- *RECURSION*
- [2]=>
- *RECURSION*
- }
+ *RECURSION*
[2]=>
- &array(3) {
- [0]=>
- int(2)
- [1]=>
- *RECURSION*
- [2]=>
- *RECURSION*
- }
+ *RECURSION*
}
[2]=>
&array(3) {
[0]=>
int(2)
[1]=>
- &array(3) {
- [0]=>
- int(2)
- [1]=>
- *RECURSION*
- [2]=>
- *RECURSION*
- }
+ *RECURSION*
[2]=>
- &array(3) {
- [0]=>
- int(2)
- [1]=>
- *RECURSION*
- [2]=>
- *RECURSION*
- }
+ *RECURSION*
}
}
-
diff --git a/Zend/tests/bug35163_3.phpt b/Zend/tests/bug35163_3.phpt
index d2b3c25bf..6c6a57f25 100755
--- a/Zend/tests/bug35163_3.phpt
+++ b/Zend/tests/bug35163_3.phpt
@@ -11,29 +11,15 @@ var_dump($a);
$a->b = null;
$a = null;
?>
---EXPECT--
-object(stdClass)#1 (1) {
+--EXPECTF--
+object(stdClass)#%d (1) {
["b"]=>
&array(3) {
[0]=>
int(2)
[1]=>
- &array(3) {
- [0]=>
- int(2)
- [1]=>
- *RECURSION*
- [2]=>
- *RECURSION*
- }
+ *RECURSION*
[2]=>
- &array(3) {
- [0]=>
- int(2)
- [1]=>
- *RECURSION*
- [2]=>
- *RECURSION*
- }
+ *RECURSION*
}
}
diff --git a/Zend/tests/bug35239.phpt b/Zend/tests/bug35239.phpt
index 7fc7b7d3b..869971e2a 100755
--- a/Zend/tests/bug35239.phpt
+++ b/Zend/tests/bug35239.phpt
@@ -12,30 +12,16 @@ var_dump($a);
$a->x0->y1 = "ok\n";
echo $a->x0;
?>
---EXPECT--
-object(stdClass)#1 (1) {
+--EXPECTF--
+object(stdClass)#%d (1) {
["x0"]=>
- &object(stdClass)#2 (3) {
+ &object(stdClass)#%d (3) {
["y0"]=>
string(1) "b"
["y1"]=>
- &object(stdClass)#2 (3) {
- ["y0"]=>
- string(1) "b"
- ["y1"]=>
- *RECURSION*
- ["y2"]=>
- *RECURSION*
- }
+ *RECURSION*
["y2"]=>
- &object(stdClass)#2 (3) {
- ["y0"]=>
- string(1) "b"
- ["y1"]=>
- *RECURSION*
- ["y2"]=>
- *RECURSION*
- }
+ *RECURSION*
}
}
ok
diff --git a/Zend/tests/bug35634.phpt b/Zend/tests/bug35634.phpt
index 9681b6ad4..1437017a3 100755
--- a/Zend/tests/bug35634.phpt
+++ b/Zend/tests/bug35634.phpt
@@ -30,7 +30,9 @@ if (defined("pass3")) {
set_error_handler('errorHandler');
define("pass2", 1);
include(__FILE__);
+ print "ok\n";
}
+
?>
---EXPECTF--
-Error: Redefining already defined constructor for class TestClass (%sbug35634.php:12)
+--EXPECT--
+ok
diff --git a/Zend/tests/bug45180.phpt b/Zend/tests/bug45180.phpt
index 285543aaf..4e1ab9ee0 100644
--- a/Zend/tests/bug45180.phpt
+++ b/Zend/tests/bug45180.phpt
@@ -43,11 +43,11 @@ __call:
string(3) "ABC"
__call:
string(3) "ABC"
-__call:
+__callstatic:
string(3) "XYZ"
-__call:
+__callstatic:
string(3) "WWW"
-__call:
+__callstatic:
string(3) "ABC"
__callstatic:
string(1) "A"
diff --git a/Zend/tests/bug45186.phpt b/Zend/tests/bug45186.phpt
index bcf88a189..da7ac73f5 100644
--- a/Zend/tests/bug45186.phpt
+++ b/Zend/tests/bug45186.phpt
@@ -35,17 +35,17 @@ call_user_func('self::y');
?>
--EXPECTF--
-__call:
+__callstatic:
string(3) "ABC"
-__call:
+__callstatic:
string(3) "ABC"
__call:
string(3) "xyz"
-__call:
+__callstatic:
string(3) "www"
__call:
string(1) "y"
-__call:
+__callstatic:
string(1) "y"
ok
__callstatic:
diff --git a/Zend/tests/bug45877.phpt b/Zend/tests/bug45877.phpt
index 270377056..ec44cb061 100644
--- a/Zend/tests/bug45877.phpt
+++ b/Zend/tests/bug45877.phpt
@@ -1,7 +1,7 @@
--TEST--
Bug #45877 (Array key '2147483647' left as string)
--INI--
-precision=20
+precision=16
--FILE--
<?php
$keys = array(PHP_INT_MAX,
@@ -18,6 +18,6 @@ array(3) {
int(1)
[-%d8]=>
int(1)
- ["%d8"]=>
+ ["%s"]=>
int(1)
}
diff --git a/Zend/tests/bug46665.phpt b/Zend/tests/bug46665.phpt
index 8e7fc086d..1f8245438 100644
--- a/Zend/tests/bug46665.phpt
+++ b/Zend/tests/bug46665.phpt
@@ -12,4 +12,4 @@ function __autoload($class) {
?>
--EXPECTF--
-%string|unicode%(12) "\Foo\Bar\Baz"
+%string|unicode%(11) "Foo\Bar\Baz"
diff --git a/Zend/tests/bug48215.phpt b/Zend/tests/bug48215.phpt
index 99c4dd289..2e156ad7f 100644
--- a/Zend/tests/bug48215.phpt
+++ b/Zend/tests/bug48215.phpt
@@ -29,8 +29,6 @@ $b->A();
?>
===DONE===
--EXPECTF--
-
-Strict Standards: Redefining already defined constructor for class A in %s on line %d
B::__construct
A::__construct
B::A
diff --git a/Zend/tests/bug48215_2.phpt b/Zend/tests/bug48215_2.phpt
index 30f0734ac..199a25220 100644
--- a/Zend/tests/bug48215_2.phpt
+++ b/Zend/tests/bug48215_2.phpt
@@ -16,7 +16,4 @@ $c = new c();
?>
===DONE===
--EXPECTF--
-
-Strict Standards: Redefining already defined constructor for class a in %s on line %d
-
Fatal error: Call to undefined method b::b() in %s on line %d
diff --git a/Zend/tests/bug48930.phpt b/Zend/tests/bug48930.phpt
new file mode 100644
index 000000000..13b67f236
--- /dev/null
+++ b/Zend/tests/bug48930.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #48930 (__COMPILER_HALT_OFFSET__ incorrect in PHP>=5.3)
+--FILE--
+#!php
+<?php
+
+/*
+ * Test
+ */
+printf("__COMPILER_HALT_OFFSET__ is %d\n",__COMPILER_HALT_OFFSET__);
+
+__halt_compiler();
+
+?>
+--EXPECT--
+__COMPILER_HALT_OFFSET__ is 116
diff --git a/Zend/tests/bug49893.phpt b/Zend/tests/bug49893.phpt
new file mode 100644
index 000000000..b340f7bdf
--- /dev/null
+++ b/Zend/tests/bug49893.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #49893 (Crash while creating an instance of Zend_Mail_Storage_Pop3)
+--FILE--
+<?php
+class A {
+ function __destruct() {
+ try {
+ throw new Exception("2");
+ } catch (Exception $e) {
+ echo $e->getMessage() . "\n";
+ }
+ }
+}
+class B {
+ function __construct() {
+ $this->a = new A();
+ throw new Exception("1");
+ }
+}
+try {
+ $b = new B();
+} catch(Exception $e) {
+ echo $e->getMessage() . "\n";;
+}
+?>
+--EXPECT--
+2
+1
diff --git a/Zend/tests/bug50383.phpt b/Zend/tests/bug50383.phpt
new file mode 100644
index 000000000..2210c4bc3
--- /dev/null
+++ b/Zend/tests/bug50383.phpt
@@ -0,0 +1,130 @@
+--TEST--
+Bug #50383 (Exceptions thrown in __call / __callStatic do not include file and line in trace)
+--FILE--
+<?php
+
+class myClass {
+ public static function __callStatic($method, $args) {
+ throw new Exception("Missing static method '$method'\n");
+ }
+ public function __call($method, $args) {
+ throw new Exception("Missing method '$method'\n");
+ }
+}
+
+function thrower() {
+ myClass::ThrowException();
+}
+function thrower2() {
+ $x = new myClass;
+ $x->foo();
+}
+
+try {
+ thrower();
+} catch(Exception $e) {
+ print $e->getMessage();
+ print_r($e->getTrace());
+}
+
+try {
+ thrower2();
+} catch (Exception $e) {
+ print $e->getMessage();
+ print_r($e->getTrace());
+}
+
+?>
+--EXPECTF--
+Missing static method 'ThrowException'
+Array
+(
+ [0] => Array
+ (
+ [file] => %s
+ [line] => 13
+ [function] => __callStatic
+ [class] => myClass
+ [type] => ::
+ [args] => Array
+ (
+ [0] => ThrowException
+ [1] => Array
+ (
+ )
+
+ )
+
+ )
+
+ [1] => Array
+ (
+ [file] => %s
+ [line] => 13
+ [function] => ThrowException
+ [class] => myClass
+ [type] => ::
+ [args] => Array
+ (
+ )
+
+ )
+
+ [2] => Array
+ (
+ [file] => %s
+ [line] => 21
+ [function] => thrower
+ [args] => Array
+ (
+ )
+
+ )
+
+)
+Missing method 'foo'
+Array
+(
+ [0] => Array
+ (
+ [file] => %s
+ [line] => 17
+ [function] => __call
+ [class] => myClass
+ [type] => ->
+ [args] => Array
+ (
+ [0] => foo
+ [1] => Array
+ (
+ )
+
+ )
+
+ )
+
+ [1] => Array
+ (
+ [file] => %s
+ [line] => 17
+ [function] => foo
+ [class] => myClass
+ [type] => ->
+ [args] => Array
+ (
+ )
+
+ )
+
+ [2] => Array
+ (
+ [file] => %s
+ [line] => 28
+ [function] => thrower2
+ [args] => Array
+ (
+ )
+
+ )
+
+)
diff --git a/Zend/tests/bug50810.phpt b/Zend/tests/bug50810.phpt
new file mode 100644
index 000000000..8b4d7190e
--- /dev/null
+++ b/Zend/tests/bug50810.phpt
@@ -0,0 +1,46 @@
+--TEST--
+Bug #50810 (property_exists does not work for private)
+--FILE--
+<?php
+
+class ExampleSuperClass
+{
+ private $foo;
+ static protected $bar;
+
+ private function foo()
+ {
+ }
+
+ public function propertyFooExists()
+ {
+ return property_exists($this, 'foo');
+ }
+
+}
+
+class ExampleSubClass extends ExampleSuperClass
+{
+ public function methodExists()
+ {
+ return method_exists($this, 'foo');
+ }
+
+ public function propertyBarExists()
+ {
+ return property_exists($this, 'bar');
+ }
+}
+
+$example = new ExampleSubClass();
+var_dump($example->methodExists());
+var_dump(method_exists($example, 'propertyFooExists'));
+var_dump($example->propertyFooExists());
+var_dump($example->propertyBarExists());
+
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
diff --git a/Zend/tests/bug51176.phpt b/Zend/tests/bug51176.phpt
new file mode 100644
index 000000000..436378eff
--- /dev/null
+++ b/Zend/tests/bug51176.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Bug #51176 (Static calling in non-static method behaves like $this->)
+--FILE--
+<?php
+class Foo
+{
+ public function start()
+ {
+ self::bar();
+ static::bar();
+ Foo::bar();
+ }
+
+ public function __call($n, $a)
+ {
+ echo "instance\n";
+ }
+
+ public static function __callStatic($n, $a)
+ {
+ echo "static\n";
+ }
+}
+
+$foo = new Foo();
+$foo->start();
+
+?>
+--EXPECT--
+static
+static
+static
diff --git a/Zend/tests/bug51394.phpt b/Zend/tests/bug51394.phpt
new file mode 100644
index 000000000..537574c9d
--- /dev/null
+++ b/Zend/tests/bug51394.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #51394 (Error line reported incorrectly if error handler throws an exception)
+--INI--
+error_reporting=-1
+--FILE--
+<?php
+function eh()
+{
+ throw new Exception("error!");
+ return false;
+}
+
+set_error_handler("eh");
+$a = $empty($b);
+--EXPECTF--
+Fatal error: Function name must be a string in %sbug51394.php on line 9 \ No newline at end of file
diff --git a/Zend/tests/bug51791.phpt b/Zend/tests/bug51791.phpt
new file mode 100644
index 000000000..b6ced4bcc
--- /dev/null
+++ b/Zend/tests/bug51791.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #51791 (constant() failed to check undefined constant and php interpreter stoped)
+--FILE--
+<?php
+
+class A {
+ const B = 1;
+}
+var_dump(constant('A::B1'));
+
+?>
+--EXPECTF--
+Warning: constant(): Couldn't find constant A::B1 in %s on line %d
+NULL
diff --git a/Zend/tests/bug51822.phpt b/Zend/tests/bug51822.phpt
new file mode 100644
index 000000000..cffae7bb1
--- /dev/null
+++ b/Zend/tests/bug51822.phpt
@@ -0,0 +1,40 @@
+--TEST--
+Bug #51822 (Segfault with strange __destruct() for static class variables)
+--FILE--
+<?php
+class DestructableObject
+{
+ public function __destruct()
+ {
+ echo "2\n";
+ }
+}
+
+class DestructorCreator
+{
+ public function __destruct()
+ {
+ $this->test = new DestructableObject;
+ echo "1\n";
+ }
+}
+
+class Test
+{
+ public static $mystatic;
+}
+
+// Uncomment this to avoid segfault
+//Test::$mystatic = new DestructorCreator();
+
+$x = new Test();
+
+if (!isset(Test::$mystatic))
+ Test::$mystatic = new DestructorCreator();
+
+echo "bla\n";
+?>
+--EXPECT--
+bla
+1
+2
diff --git a/Zend/tests/bug51827.phpt b/Zend/tests/bug51827.phpt
new file mode 100644
index 000000000..083474945
--- /dev/null
+++ b/Zend/tests/bug51827.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #51827 (Bad warning when register_shutdown_function called with wrong num of parameters)
+--FILE--
+<?php
+
+
+function abc() {
+ var_dump(1);
+}
+
+register_shutdown_function('timE');
+register_shutdown_function('ABC');
+register_shutdown_function('exploDe');
+
+?>
+--EXPECTF--
+int(1)
+
+Warning: explode() expects at least 2 parameters, 0 given in Unknown on line %d
diff --git a/Zend/tests/bug52001.phpt b/Zend/tests/bug52001.phpt
new file mode 100644
index 000000000..cf55d195b
--- /dev/null
+++ b/Zend/tests/bug52001.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #52001 (Memory allocation problems after using variable variables)
+--FILE--
+<?php
+a(0,$$var);
+
+$temp1=1;
+$temp2=2;
+var_dump($temp1);
+
+function a($b,$c) {}
+?>
+--EXPECTF--
+Notice: Undefined variable: var in %sbug52001.php on line 2
+
+Notice: Undefined variable: in %sbug52001.php on line 2
+int(1)
diff --git a/Zend/tests/bug52041.phpt b/Zend/tests/bug52041.phpt
new file mode 100644
index 000000000..b481b894d
--- /dev/null
+++ b/Zend/tests/bug52041.phpt
@@ -0,0 +1,50 @@
+--TEST--
+Bug #52041 (Memory leak when writing on uninitialized variable returned from function)
+--FILE--
+<?php
+function foo() {
+ return $x;
+}
+
+foo()->a = 1;
+foo()->a->b = 2;
+foo()->a++;
+foo()->a->b++;
+foo()->a += 2;
+foo()->a->b += 2;
+
+//foo()[0] = 1;
+//foo()[0][0] = 2;
+//foo()[0]++;
+//foo()[0][0]++;
+//foo()[0] += 2;
+//foo()[0][0] += 2;
+var_dump(foo());
+?>
+--EXPECTF--
+Notice: Undefined variable: x in %sbug52041.php on line 3
+
+Strict Standards: Creating default object from empty value in %sbug52041.php on line 6
+
+Notice: Undefined variable: x in %sbug52041.php on line 3
+
+Strict Standards: Creating default object from empty value in %sbug52041.php on line 7
+
+Notice: Undefined variable: x in %sbug52041.php on line 3
+
+Strict Standards: Creating default object from empty value in %sbug52041.php on line 8
+
+Notice: Undefined variable: x in %sbug52041.php on line 3
+
+Strict Standards: Creating default object from empty value in %sbug52041.php on line 9
+
+Notice: Undefined variable: x in %sbug52041.php on line 3
+
+Strict Standards: Creating default object from empty value in %sbug52041.php on line 10
+
+Notice: Undefined variable: x in %sbug52041.php on line 3
+
+Strict Standards: Creating default object from empty value in %sbug52041.php on line 11
+
+Notice: Undefined variable: x in %sbug52041.php on line 3
+NULL
diff --git a/Zend/tests/bug52051.phpt b/Zend/tests/bug52051.phpt
new file mode 100644
index 000000000..e8a4f49e3
--- /dev/null
+++ b/Zend/tests/bug52051.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #52051 (handling of case sensitivity of old-style constructors changed in 5.3+)
+--FILE--
+<?php
+
+class AA {
+ function AA() { echo "foo\n"; }
+}
+class bb extends AA {}
+class CC extends bb {
+ function CC() { parent::bb(); }
+}
+new CC();
+
+class A {
+ function A() { echo "bar\n"; }
+}
+class B extends A {}
+class C extends B {
+ function C() { parent::B(); }
+}
+new C();
+
+?>
+--EXPECT--
+foo
+bar
diff --git a/Zend/tests/bug52060.phpt b/Zend/tests/bug52060.phpt
new file mode 100644
index 000000000..fef603b0c
--- /dev/null
+++ b/Zend/tests/bug52060.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #52060 (Memory leak when passing a closure to method_exists())
+--FILE--
+<?php
+
+$closure = function($a) { echo $a; };
+
+var_dump(method_exists($closure, '__invoke')); // true
+
+?>
+--EXPECT--
+bool(true)
diff --git a/Zend/tests/bug52160.phpt b/Zend/tests/bug52160.phpt
new file mode 100644
index 000000000..c85d2f09a
--- /dev/null
+++ b/Zend/tests/bug52160.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Bug #52160 (Invalid E_STRICT redefined constructor error)
+--FILE--
+<?php
+
+class bar {
+ function __construct() { }
+ static function bar() {
+ var_dump(1);
+ }
+}
+
+bar::bar();
+
+class foo {
+ static function foo() {
+ var_dump(2);
+ }
+ function __construct() { }
+}
+
+foo::foo();
+
+class baz {
+ static function baz() {
+ var_dump(3);
+ }
+}
+
+?>
+--EXPECTF--
+Strict Standards: Redefining already defined constructor for class foo in %s on line %d
+
+Fatal error: Constructor baz::baz() cannot be static in %s on line %d
diff --git a/Zend/tests/bug52193.phpt b/Zend/tests/bug52193.phpt
new file mode 100644
index 000000000..7452672e3
--- /dev/null
+++ b/Zend/tests/bug52193.phpt
@@ -0,0 +1,78 @@
+--TEST--
+Bug #52193 (converting closure to array yields empty array)
+--FILE--
+<?php
+
+var_dump((array) 1);
+var_dump((array) NULL);
+var_dump((array) new stdclass);
+var_dump($h = (array) function () { return 2; });
+var_dump($h[0]());
+
+$i = function () use (&$h) {
+ return $h;
+};
+
+var_dump($x = (array)$i);
+var_dump($y = $x[0]);
+var_dump($y());
+
+$items = range(1, 5);
+$func = function(){ return 'just a test'; };
+
+array_splice($items, 0 , 4, $func);
+var_dump($items);
+
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ int(1)
+}
+array(0) {
+}
+array(0) {
+}
+array(1) {
+ [0]=>
+ object(Closure)#%d (0) {
+ }
+}
+int(2)
+array(1) {
+ [0]=>
+ object(Closure)#%d (1) {
+ ["static"]=>
+ array(1) {
+ ["h"]=>
+ &array(1) {
+ [0]=>
+ object(Closure)#%d (0) {
+ }
+ }
+ }
+ }
+}
+object(Closure)#%d (1) {
+ ["static"]=>
+ array(1) {
+ ["h"]=>
+ &array(1) {
+ [0]=>
+ object(Closure)#%d (0) {
+ }
+ }
+ }
+}
+array(1) {
+ [0]=>
+ object(Closure)#%d (0) {
+ }
+}
+array(2) {
+ [0]=>
+ object(Closure)#%d (0) {
+ }
+ [1]=>
+ int(5)
+}
diff --git a/Zend/tests/bug52237.phpt b/Zend/tests/bug52237.phpt
new file mode 100644
index 000000000..a466a8ce0
--- /dev/null
+++ b/Zend/tests/bug52237.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #52237 (Crash when passing the reference of the property of a non-object)
+--FILE--
+<?php
+$data = 'test';
+preg_match('//', '', $data->info);
+var_dump($data);
+?>
+--EXPECTF--
+Warning: Attempt to modify property of non-object in %sbug52237.php on line 3
+string(4) "test"
diff --git a/Zend/tests/call_static_003.phpt b/Zend/tests/call_static_003.phpt
index 566ff0fdf..d5e2b7529 100644
--- a/Zend/tests/call_static_003.phpt
+++ b/Zend/tests/call_static_003.phpt
@@ -28,9 +28,9 @@ foo::BAZ();
--EXPECT--
nonstatic
string(6) "fOoBaR"
-nonstatic
+static
string(6) "foOBAr"
-nonstatic
+static
string(6) "fOOBAr"
static
string(3) "bAr"
diff --git a/Zend/tests/call_static_007.phpt b/Zend/tests/call_static_007.phpt
index 419f10231..766802092 100644
--- a/Zend/tests/call_static_007.phpt
+++ b/Zend/tests/call_static_007.phpt
@@ -30,5 +30,5 @@ a::Foo();
--EXPECT--
__callstatic: Test
__call: Test
-__call: Bar
+__callstatic: Bar
__callstatic: Foo
diff --git a/Zend/tests/closure_020.phpt b/Zend/tests/closure_020.phpt
index 7b4c60b9b..9d04a9af5 100644
--- a/Zend/tests/closure_020.phpt
+++ b/Zend/tests/closure_020.phpt
@@ -31,18 +31,7 @@ object(foo)#%d (%d) {
["static"]=>
array(1) {
["a"]=>
- &object(foo)#%d (2) {
- ["test":"foo":private]=>
- int(3)
- ["a"]=>
- object(Closure)#%d (1) {
- ["static"]=>
- array(1) {
- ["a"]=>
- *RECURSION*
- }
- }
- }
+ *RECURSION*
}
}
}
diff --git a/Zend/tests/closure_034.phpt b/Zend/tests/closure_034.phpt
index d1356c31d..8ba276a68 100644
--- a/Zend/tests/closure_034.phpt
+++ b/Zend/tests/closure_034.phpt
@@ -9,17 +9,11 @@ var_dump($a);
?>
===DONE===
--EXPECTF--
-object(Closure)#1 (1) {
+object(Closure)#%d (1) {
["static"]=>
array(1) {
["a"]=>
- &object(Closure)#1 (1) {
- ["static"]=>
- array(1) {
- ["a"]=>
- *RECURSION*
- }
- }
+ *RECURSION*
}
}
===DONE===
diff --git a/Zend/tests/closure_035.phpt b/Zend/tests/closure_035.phpt
index ac8b4caea..e39a991ab 100644
--- a/Zend/tests/closure_035.phpt
+++ b/Zend/tests/closure_035.phpt
@@ -18,14 +18,8 @@ var_dump($x());
object(Closure)#%d (1) {
["static"]=>
array(1) {
- [%u|b%"x"]=>
- &object(Closure)#%d (1) {
- ["static"]=>
- array(1) {
- [%u|b%"x"]=>
- *RECURSION*
- }
- }
+ ["x"]=>
+ *RECURSION*
}
}
int(1)
diff --git a/Zend/tests/foreach_002.phpt b/Zend/tests/foreach_002.phpt
index 643e65392..5523424ce 100644
--- a/Zend/tests/foreach_002.phpt
+++ b/Zend/tests/foreach_002.phpt
@@ -15,9 +15,6 @@ array(1) {
["a"]=>
&array(1) {
["a"]=>
- &array(1) {
- ["a"]=>
- *RECURSION*
- }
+ *RECURSION*
}
}
diff --git a/Zend/tests/gc_004.phpt b/Zend/tests/gc_004.phpt
index ce6a94b79..1b6f70abe 100644
--- a/Zend/tests/gc_004.phpt
+++ b/Zend/tests/gc_004.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 004: Simple array cycle
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a = array();
@@ -14,10 +16,7 @@ array(1) {
[0]=>
&array(1) {
[0]=>
- &array(1) {
- [0]=>
- *RECURSION*
- }
+ *RECURSION*
}
}
int(1)
diff --git a/Zend/tests/gc_005.phpt b/Zend/tests/gc_005.phpt
index 0660ded2f..71fb8909f 100644
--- a/Zend/tests/gc_005.phpt
+++ b/Zend/tests/gc_005.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 005: Simple object cycle
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a = new stdClass();
@@ -9,13 +11,10 @@ unset($a);
var_dump(gc_collect_cycles());
echo "ok\n"
?>
---EXPECT--
-object(stdClass)#1 (1) {
+--EXPECTF--
+object(stdClass)#%d (1) {
["a"]=>
- object(stdClass)#1 (1) {
- ["a"]=>
- *RECURSION*
- }
+ *RECURSION*
}
int(1)
ok
diff --git a/Zend/tests/gc_006.phpt b/Zend/tests/gc_006.phpt
index 4ba0d9267..c633d038f 100644
--- a/Zend/tests/gc_006.phpt
+++ b/Zend/tests/gc_006.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 006: Simple array-object cycle
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a = new stdClass();
@@ -10,18 +12,12 @@ unset($a);
var_dump(gc_collect_cycles());
echo "ok\n"
?>
---EXPECT--
-object(stdClass)#1 (1) {
+--EXPECTF--
+object(stdClass)#%d (1) {
["a"]=>
array(1) {
[0]=>
- &object(stdClass)#1 (1) {
- ["a"]=>
- array(1) {
- [0]=>
- *RECURSION*
- }
- }
+ *RECURSION*
}
}
int(2)
diff --git a/Zend/tests/gc_007.phpt b/Zend/tests/gc_007.phpt
index 4baa5e666..8601ea43b 100644
--- a/Zend/tests/gc_007.phpt
+++ b/Zend/tests/gc_007.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 007: Unreferensed array cycle
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a = array(array());
@@ -15,10 +17,7 @@ array(1) {
[0]=>
&array(1) {
[0]=>
- &array(1) {
- [0]=>
- *RECURSION*
- }
+ *RECURSION*
}
}
int(0)
diff --git a/Zend/tests/gc_008.phpt b/Zend/tests/gc_008.phpt
index b62504bd2..289d581d6 100644
--- a/Zend/tests/gc_008.phpt
+++ b/Zend/tests/gc_008.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 008: Unreferensed object cycle
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a = new stdClass();
@@ -11,13 +13,10 @@ unset($a);
var_dump(gc_collect_cycles());
echo "ok\n"
?>
---EXPECT--
-object(stdClass)#2 (1) {
+--EXPECTF--
+object(stdClass)#%d (1) {
["a"]=>
- object(stdClass)#2 (1) {
- ["a"]=>
- *RECURSION*
- }
+ *RECURSION*
}
int(0)
int(1)
diff --git a/Zend/tests/gc_009.phpt b/Zend/tests/gc_009.phpt
index 02ee1ae03..263d31f45 100644
--- a/Zend/tests/gc_009.phpt
+++ b/Zend/tests/gc_009.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 009: Unreferensed array-object cycle
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a = array();
@@ -12,18 +14,12 @@ unset($a);
var_dump(gc_collect_cycles());
echo "ok\n"
?>
---EXPECT--
-object(stdClass)#1 (1) {
+--EXPECTF--
+object(stdClass)#%d (1) {
["a"]=>
array(1) {
[0]=>
- &object(stdClass)#1 (1) {
- ["a"]=>
- array(1) {
- [0]=>
- *RECURSION*
- }
- }
+ *RECURSION*
}
}
int(0)
diff --git a/Zend/tests/gc_010.phpt b/Zend/tests/gc_010.phpt
index d39ef8a09..af2dda3fe 100644
--- a/Zend/tests/gc_010.phpt
+++ b/Zend/tests/gc_010.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 010: Cycle with reference to $GLOBALS
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a = array();
@@ -15,10 +17,7 @@ array(1) {
[0]=>
&array(1) {
[0]=>
- &array(1) {
- [0]=>
- *RECURSION*
- }
+ *RECURSION*
}
}
int(1)
diff --git a/Zend/tests/gc_011.phpt b/Zend/tests/gc_011.phpt
index 97819be23..9c4cc2cc0 100644
--- a/Zend/tests/gc_011.phpt
+++ b/Zend/tests/gc_011.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 011: GC and destructors
+--INI--
+zend.enable_gc=1
--FILE--
<?php
class Foo {
@@ -15,13 +17,10 @@ unset($a);
var_dump(gc_collect_cycles());
echo "ok\n"
?>
---EXPECT--
-object(Foo)#1 (1) {
+--EXPECTF--
+object(Foo)#%d (1) {
["a"]=>
- object(Foo)#1 (1) {
- ["a"]=>
- *RECURSION*
- }
+ *RECURSION*
}
__destruct
int(1)
diff --git a/Zend/tests/gc_012.phpt b/Zend/tests/gc_012.phpt
index eff76ef31..f6c853897 100644
--- a/Zend/tests/gc_012.phpt
+++ b/Zend/tests/gc_012.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 012: collection of many loops at once
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a=array();
diff --git a/Zend/tests/gc_013.phpt b/Zend/tests/gc_013.phpt
index ddfa0e6ba..9209ca2b4 100644
--- a/Zend/tests/gc_013.phpt
+++ b/Zend/tests/gc_013.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 013: Too many cycles in one array
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a = array();
diff --git a/Zend/tests/gc_014.phpt b/Zend/tests/gc_014.phpt
index 8167880f9..9f43fc850 100644
--- a/Zend/tests/gc_014.phpt
+++ b/Zend/tests/gc_014.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 014: Too many cycles in one object
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a = new stdClass();
diff --git a/Zend/tests/gc_015.phpt b/Zend/tests/gc_015.phpt
index be3c5eb9d..df85836ed 100644
--- a/Zend/tests/gc_015.phpt
+++ b/Zend/tests/gc_015.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 015: Object as root of cycle
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a = new stdClass();
diff --git a/Zend/tests/gc_016.phpt b/Zend/tests/gc_016.phpt
index 6d6a36307..f1e14dab1 100644
--- a/Zend/tests/gc_016.phpt
+++ b/Zend/tests/gc_016.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 016: nested GC calls
+--INI--
+zend.enable_gc=1
--FILE--
<?php
class Foo {
diff --git a/Zend/tests/gc_017.phpt b/Zend/tests/gc_017.phpt
index 9df04e280..50be61025 100644
--- a/Zend/tests/gc_017.phpt
+++ b/Zend/tests/gc_017.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 017: GC and destructors with unset
+--INI--
+zend.enable_gc=1
--FILE--
<?php
class Node {
diff --git a/Zend/tests/gc_018.phpt b/Zend/tests/gc_018.phpt
index c202d8cdc..ef797ae6d 100644
--- a/Zend/tests/gc_018.phpt
+++ b/Zend/tests/gc_018.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 018: GC detach with assign
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a = array(array());
diff --git a/Zend/tests/gc_019.phpt b/Zend/tests/gc_019.phpt
index 12400d2f0..17d0f73be 100644
--- a/Zend/tests/gc_019.phpt
+++ b/Zend/tests/gc_019.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 019: GC detach with assign by reference
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a = array(array());
diff --git a/Zend/tests/gc_020.phpt b/Zend/tests/gc_020.phpt
index 76e8aff9a..8f22e1b4b 100644
--- a/Zend/tests/gc_020.phpt
+++ b/Zend/tests/gc_020.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 020: GC detach reference with assign
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a = array();
diff --git a/Zend/tests/gc_021.phpt b/Zend/tests/gc_021.phpt
index 4e6c75094..3db702ac5 100644
--- a/Zend/tests/gc_021.phpt
+++ b/Zend/tests/gc_021.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 021: GC detach reference with assign by reference
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a = array();
diff --git a/Zend/tests/gc_022.phpt b/Zend/tests/gc_022.phpt
index 0418bf9a0..5d7bb8494 100644
--- a/Zend/tests/gc_022.phpt
+++ b/Zend/tests/gc_022.phpt
@@ -2,6 +2,7 @@
GC 022: GC detach reference in executor's PZVAL_UNLOCK()
--INI--
error_reporting=0
+zend.enable_gc=1
--FILE--
<?php
$a = array(array());
diff --git a/Zend/tests/gc_023.phpt b/Zend/tests/gc_023.phpt
index 3c0580129..6d6e1e637 100644
--- a/Zend/tests/gc_023.phpt
+++ b/Zend/tests/gc_023.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 023: Root buffer overflow (automatic collection)
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a=array();
diff --git a/Zend/tests/gc_024.phpt b/Zend/tests/gc_024.phpt
index ee734d628..a139e95da 100644
--- a/Zend/tests/gc_024.phpt
+++ b/Zend/tests/gc_024.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 024: GC and objects with non-standard handlers
+--INI--
+zend.enable_gc=1
--SKIPIF--
<?php if (!extension_loaded("spl")) print "skip"; ?>
--FILE--
diff --git a/Zend/tests/gc_025.phpt b/Zend/tests/gc_025.phpt
index 5ae652725..f838ed307 100644
--- a/Zend/tests/gc_025.phpt
+++ b/Zend/tests/gc_025.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 025: Automatic GC on request shutdown
+--INI--
+zend.enable_gc=1
--FILE--
<?php
$a = array(array());
diff --git a/Zend/tests/gc_027.phpt b/Zend/tests/gc_027.phpt
index 9d2418eb4..d499cc314 100644
--- a/Zend/tests/gc_027.phpt
+++ b/Zend/tests/gc_027.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 027: GC and properties of internal classes
+--INI--
+zend.enable_gc=1
--FILE--
<?php
try {
diff --git a/Zend/tests/gc_028.phpt b/Zend/tests/gc_028.phpt
index 6f330cb60..8dc70fc39 100644
--- a/Zend/tests/gc_028.phpt
+++ b/Zend/tests/gc_028.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 028: GC and destructors
+--INI--
+zend.enable_gc=1
--FILE--
<?php
class Foo {
diff --git a/Zend/tests/gc_029.phpt b/Zend/tests/gc_029.phpt
index ea0660eca..438053414 100644
--- a/Zend/tests/gc_029.phpt
+++ b/Zend/tests/gc_029.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 029: GC and destructors
+--INI--
+zend.enable_gc=1
--FILE--
<?php
class Foo {
diff --git a/Zend/tests/gc_030.phpt b/Zend/tests/gc_030.phpt
index 27db29d98..ef044e0f0 100644
--- a/Zend/tests/gc_030.phpt
+++ b/Zend/tests/gc_030.phpt
@@ -1,5 +1,7 @@
--TEST--
GC 030: GC and exceptions in destructors
+--INI--
+zend.enable_gc=1
--FILE--
<?php
class foo {
@@ -28,4 +30,4 @@ Next exception 'Exception' with message 'foobar' in %sgc_030.php:%d
Stack trace:
#0 %sgc_030.php(%d): foo->__destruct()
#1 {main}
- thrown in %sgc_030.php on line %d \ No newline at end of file
+ thrown in %sgc_030.php on line %d
diff --git a/Zend/tests/ns_063.phpt b/Zend/tests/ns_063.phpt
index 1be000983..dbe34b428 100644
--- a/Zend/tests/ns_063.phpt
+++ b/Zend/tests/ns_063.phpt
@@ -1,5 +1,5 @@
--TEST--
-063: Support for old-style constructors in namesapces
+063: Old-style constructors in namesapces (not supported!)
--FILE--
<?php
namespace Foo;
@@ -9,5 +9,6 @@ class Bar {
}
}
new Bar();
+echo "ok\n";
--EXPECT--
ok
diff --git a/Zend/tests/objects_011.phpt b/Zend/tests/objects_011.phpt
index eb1fc0c1f..c7d1e876f 100644
--- a/Zend/tests/objects_011.phpt
+++ b/Zend/tests/objects_011.phpt
@@ -14,6 +14,5 @@ class test {
echo "Done\n";
?>
---EXPECTF--
-Strict Standards: Redefining already defined constructor for class test in %s on line %d
+--EXPECT--
Done
diff --git a/Zend/tests/objects_020.phpt b/Zend/tests/objects_020.phpt
index b7c709f32..14e34b915 100644
--- a/Zend/tests/objects_020.phpt
+++ b/Zend/tests/objects_020.phpt
@@ -13,18 +13,10 @@ $$test->a->b[] = 2;
var_dump($$test);
?>
---EXPECT--
-object(stdClass)#1 (2) {
+--EXPECTF--
+object(stdClass)#%d (2) {
["a"]=>
- &object(stdClass)#1 (2) {
- ["a"]=>
- *RECURSION*
- ["b"]=>
- array(1) {
- [0]=>
- int(2)
- }
- }
+ *RECURSION*
["b"]=>
array(1) {
[0]=>