]> granicus.if.org Git - php/commitdiff
MFH: new tests
authorAntony Dovgal <tony2001@php.net>
Wed, 7 Feb 2007 11:10:32 +0000 (11:10 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 7 Feb 2007 11:10:32 +0000 (11:10 +0000)
48 files changed:
Zend/tests/errmsg_001.phpt [new file with mode: 0644]
Zend/tests/errmsg_002.phpt [new file with mode: 0644]
Zend/tests/errmsg_003.phpt [new file with mode: 0644]
Zend/tests/errmsg_004.phpt [new file with mode: 0644]
Zend/tests/errmsg_005.phpt [new file with mode: 0644]
Zend/tests/errmsg_006.phpt [new file with mode: 0644]
Zend/tests/errmsg_007.phpt [new file with mode: 0644]
Zend/tests/errmsg_008.phpt [new file with mode: 0644]
Zend/tests/errmsg_009.phpt [new file with mode: 0644]
Zend/tests/errmsg_010.phpt [new file with mode: 0644]
Zend/tests/errmsg_011.phpt [new file with mode: 0644]
Zend/tests/errmsg_012.phpt [new file with mode: 0644]
Zend/tests/errmsg_013.phpt [new file with mode: 0644]
Zend/tests/errmsg_014.phpt [new file with mode: 0644]
Zend/tests/errmsg_015.phpt [new file with mode: 0644]
Zend/tests/errmsg_016.phpt [new file with mode: 0644]
Zend/tests/errmsg_017.phpt [new file with mode: 0644]
Zend/tests/errmsg_018.phpt [new file with mode: 0644]
Zend/tests/errmsg_019.phpt [new file with mode: 0644]
Zend/tests/errmsg_020.phpt [new file with mode: 0644]
Zend/tests/errmsg_021.phpt [new file with mode: 0644]
Zend/tests/errmsg_022.phpt [new file with mode: 0644]
Zend/tests/errmsg_023.phpt [new file with mode: 0644]
Zend/tests/errmsg_024.phpt [new file with mode: 0644]
Zend/tests/errmsg_025.phpt [new file with mode: 0644]
Zend/tests/errmsg_026.phpt [new file with mode: 0644]
Zend/tests/errmsg_027.phpt [new file with mode: 0644]
Zend/tests/errmsg_028.phpt [new file with mode: 0644]
Zend/tests/errmsg_029.phpt [new file with mode: 0644]
Zend/tests/errmsg_030.phpt [new file with mode: 0644]
Zend/tests/errmsg_031.phpt [new file with mode: 0644]
Zend/tests/errmsg_032.phpt [new file with mode: 0644]
Zend/tests/errmsg_033.phpt [new file with mode: 0644]
Zend/tests/errmsg_034.phpt [new file with mode: 0644]
Zend/tests/errmsg_035.phpt [new file with mode: 0644]
Zend/tests/errmsg_036.phpt [new file with mode: 0644]
Zend/tests/errmsg_037.phpt [new file with mode: 0644]
Zend/tests/errmsg_038.phpt [new file with mode: 0644]
Zend/tests/errmsg_039.phpt [new file with mode: 0644]
Zend/tests/errmsg_040.phpt [new file with mode: 0644]
Zend/tests/errmsg_041.phpt [new file with mode: 0644]
Zend/tests/errmsg_042.phpt [new file with mode: 0644]
Zend/tests/errmsg_043.phpt [new file with mode: 0644]
Zend/tests/globals.inc [new file with mode: 0644]
Zend/tests/globals_001.phpt [new file with mode: 0644]
Zend/tests/globals_002.phpt [new file with mode: 0644]
Zend/tests/globals_003.phpt [new file with mode: 0644]
Zend/tests/globals_004.phpt [new file with mode: 0644]

diff --git a/Zend/tests/errmsg_001.phpt b/Zend/tests/errmsg_001.phpt
new file mode 100644 (file)
index 0000000..b85e032
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+errmsg: Non-abstract method must contain body
+--FILE--
+<?php
+
+abstract class test { 
+} 
+
+class Impl extends Test { 
+       function Foo(); 
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Non-abstract method Impl::Foo() must contain body in %s on line %d
diff --git a/Zend/tests/errmsg_002.phpt b/Zend/tests/errmsg_002.phpt
new file mode 100644 (file)
index 0000000..b7330c9
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+errmsg: function cannot be declared private
+--FILE--
+<?php
+
+abstract class test {
+       abstract private function foo() {
+       }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Abstract function test::foo() cannot be declared private in %s on line %d
diff --git a/Zend/tests/errmsg_003.phpt b/Zend/tests/errmsg_003.phpt
new file mode 100644 (file)
index 0000000..64e4587
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+errmsg: cannot reassign $this (by ref)
+--FILE--
+<?php
+
+class test {
+       function foo() {
+               $a = new test;
+               $this = &$a;
+       }
+}
+
+$t = new test;
+$t->foo();
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot re-assign $this in %s on line %d
diff --git a/Zend/tests/errmsg_004.phpt b/Zend/tests/errmsg_004.phpt
new file mode 100644 (file)
index 0000000..e6d22d6
--- /dev/null
@@ -0,0 +1,15 @@
+--TEST--
+errmsg: can't use function return value in write context
+--FILE--
+<?php
+
+function foo() {
+       return "blah";
+}
+
+foo() = 1;
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Can't use function return value in write context in %s on line %d
diff --git a/Zend/tests/errmsg_005.phpt b/Zend/tests/errmsg_005.phpt
new file mode 100644 (file)
index 0000000..31c924c
--- /dev/null
@@ -0,0 +1,18 @@
+--TEST--
+errmsg: can't use method return value in write context
+--FILE--
+<?php
+
+class test {
+       function foo() {
+               return "blah";
+       }
+}
+
+$t = new test;
+$t->foo() = 1;
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Can't use method return value in write context in %s on line %d
diff --git a/Zend/tests/errmsg_006.phpt b/Zend/tests/errmsg_006.phpt
new file mode 100644 (file)
index 0000000..976093d
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+errmsg: can't use [] for reading
+--FILE--
+<?php
+
+$a = array();
+$b = $a[];
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot use [] for reading in %s on line %d
diff --git a/Zend/tests/errmsg_007.phpt b/Zend/tests/errmsg_007.phpt
new file mode 100644 (file)
index 0000000..1ac2966
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+errmsg: can't use [] for reading - 2
+--FILE--
+<?php
+
+$a = array();
+isset($a[]);
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot use [] for reading in %s on line %d
diff --git a/Zend/tests/errmsg_008.phpt b/Zend/tests/errmsg_008.phpt
new file mode 100644 (file)
index 0000000..e900603
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+errmsg: can't use [] for unsetting
+--FILE--
+<?php
+
+$a = array();
+unset($a[]);
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot use [] for unsetting in %s on line %d
diff --git a/Zend/tests/errmsg_009.phpt b/Zend/tests/errmsg_009.phpt
new file mode 100644 (file)
index 0000000..4834fa3
--- /dev/null
@@ -0,0 +1,13 @@
+--TEST--
+errmsg: multiple access type modifiers are not allowed (properties)
+--FILE--
+<?php
+
+class test {
+       public private $var;
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Multiple access type modifiers are not allowed in %s on line %d
diff --git a/Zend/tests/errmsg_010.phpt b/Zend/tests/errmsg_010.phpt
new file mode 100644 (file)
index 0000000..ae2572f
--- /dev/null
@@ -0,0 +1,13 @@
+--TEST--
+errmsg: multiple access type modifiers are not allowed (methods) 
+--FILE--
+<?php
+
+class test {
+       private protected function foo() {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Multiple access type modifiers are not allowed in %s on line %d
diff --git a/Zend/tests/errmsg_011.phpt b/Zend/tests/errmsg_011.phpt
new file mode 100644 (file)
index 0000000..9cfde0f
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+errmsg: cannot redeclare (method)
+--FILE--
+<?php
+
+class test {
+
+       function foo() {}
+       function foo() {}
+
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot redeclare test::foo() in %s on line %d
diff --git a/Zend/tests/errmsg_012.phpt b/Zend/tests/errmsg_012.phpt
new file mode 100644 (file)
index 0000000..183785b
--- /dev/null
@@ -0,0 +1,11 @@
+--TEST--
+errmsg: __autoload() must take exactly 1 argument
+--FILE--
+<?php
+
+function __autoload($a, $b) {}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: __autoload() must take exactly 1 argument in %s on line %d
diff --git a/Zend/tests/errmsg_013.phpt b/Zend/tests/errmsg_013.phpt
new file mode 100644 (file)
index 0000000..d1f248e
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+errmsg: default value for parameters with array type hint can only be an array or NULL
+--FILE--
+<?php
+
+class test {
+       function foo(array $a = "s") {
+       }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Default value for parameters with array type hint can only be an array or NULL in %s on line %d
diff --git a/Zend/tests/errmsg_014.phpt b/Zend/tests/errmsg_014.phpt
new file mode 100644 (file)
index 0000000..77e12b0
--- /dev/null
@@ -0,0 +1,17 @@
+--TEST--
+errmsg: cannot call __clone() method on objects
+--FILE--
+<?php
+
+class test {
+       function __clone() {
+       }
+}
+
+$t = new test;
+$t->__clone();
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot call __clone() method on objects - use 'clone $obj' instead in %s on line %d
diff --git a/Zend/tests/errmsg_015.phpt b/Zend/tests/errmsg_015.phpt
new file mode 100644 (file)
index 0000000..8e626e5
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+errmsg: __clone() cannot accept any arguments
+--FILE--
+<?php
+
+class test {
+       function __clone($var) {
+       }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Method test::__clone() cannot accept any arguments in %s on line %d
diff --git a/Zend/tests/errmsg_016.phpt b/Zend/tests/errmsg_016.phpt
new file mode 100644 (file)
index 0000000..ccda07b
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+errmsg: __isset() must take exactly 1 argument
+--FILE--
+<?php
+
+class test {
+       function __isset() {
+       }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Method test::__isset() must take exactly 1 argument in %s on line %d
diff --git a/Zend/tests/errmsg_017.phpt b/Zend/tests/errmsg_017.phpt
new file mode 100644 (file)
index 0000000..df2b665
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+errmsg: __unset() must take exactly 1 argument 
+--FILE--
+<?php
+
+class test {
+       function __unset() {
+       }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Method test::__unset() must take exactly 1 argument in %s on line %d
diff --git a/Zend/tests/errmsg_018.phpt b/Zend/tests/errmsg_018.phpt
new file mode 100644 (file)
index 0000000..fb05cb1
--- /dev/null
@@ -0,0 +1,15 @@
+--TEST--
+errmsg: static abstract function 
+--FILE--
+<?php
+
+class test {
+       static abstract function foo ();
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Strict Standards: Static function test::foo() should not be abstract in %s on line %d
+
+Fatal error: Class test contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (test::foo) in %s on line %d
diff --git a/Zend/tests/errmsg_019.phpt b/Zend/tests/errmsg_019.phpt
new file mode 100644 (file)
index 0000000..2b45650
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+errmsg: __destruct() cannot take arguments 
+--FILE--
+<?php
+
+class test {
+       function __destruct($var) {
+       }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Destructor test::__destruct() cannot take arguments in %s on line %d
diff --git a/Zend/tests/errmsg_020.phpt b/Zend/tests/errmsg_020.phpt
new file mode 100644 (file)
index 0000000..8199d5d
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+errmsg: disabled function
+--INI--
+disable_functions=phpinfo
+--FILE--
+<?php
+
+phpinfo();
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Warning: phpinfo() has been disabled for security reasons in %s on line %d
+Done
diff --git a/Zend/tests/errmsg_021.phpt b/Zend/tests/errmsg_021.phpt
new file mode 100644 (file)
index 0000000..4e62f85
--- /dev/null
@@ -0,0 +1,17 @@
+--TEST--
+errmsg: disabled class
+--INI--
+disable_classes=stdclass
+--FILE--
+<?php
+
+class test extends stdclass {
+}
+
+$t = new test;
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Warning: test() has been disabled for security reasons in %s on line %d
+Done
diff --git a/Zend/tests/errmsg_022.phpt b/Zend/tests/errmsg_022.phpt
new file mode 100644 (file)
index 0000000..ea7b082
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+errmsg: only variables can be passed by reference
+--FILE--
+<?php
+
+function foo (&$var) {
+}
+
+foo(1);
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Only variables can be passed by reference in %s on line %d
diff --git a/Zend/tests/errmsg_023.phpt b/Zend/tests/errmsg_023.phpt
new file mode 100644 (file)
index 0000000..9fd7804
--- /dev/null
@@ -0,0 +1,17 @@
+--TEST--
+errmsg: access level must be the same or weaker
+--FILE--
+<?php
+
+class test1 {
+       protected $var;
+}
+
+class test extends test1 { 
+       private $var;
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Access level to test::$var must be protected (as in class test1) or weaker in %s on line %d
diff --git a/Zend/tests/errmsg_024.phpt b/Zend/tests/errmsg_024.phpt
new file mode 100644 (file)
index 0000000..d8d06cb
--- /dev/null
@@ -0,0 +1,17 @@
+--TEST--
+errmsg: cannot change initial value of property
+--FILE--
+<?php
+
+class test1 {
+       static protected $var = 1;
+}
+
+class test extends test1 {
+       static $var = 10;
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot change initial value of property static protected test1::$var in class test in %s on line %d
diff --git a/Zend/tests/errmsg_025.phpt b/Zend/tests/errmsg_025.phpt
new file mode 100644 (file)
index 0000000..d853f73
--- /dev/null
@@ -0,0 +1,20 @@
+--TEST--
+errmsg: cannot inherit previously inherited constant
+--FILE--
+<?php
+
+interface test1 {
+       const FOO = 10;
+}
+
+interface test2 {
+       const FOO = 10;
+}
+
+class test implements test1, test2 {
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot inherit previously-inherited constant FOO from interface test2 in %s on line %d
diff --git a/Zend/tests/errmsg_026.phpt b/Zend/tests/errmsg_026.phpt
new file mode 100644 (file)
index 0000000..1954122
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+errmsg: cannot redeclare class
+--FILE--
+<?php
+
+class stdclass {
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot redeclare class stdclass in %s on line %d
diff --git a/Zend/tests/errmsg_027.phpt b/Zend/tests/errmsg_027.phpt
new file mode 100644 (file)
index 0000000..f4fec61
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+errmsg: class declarations may not be nested
+--FILE--
+<?php
+
+class test {
+       function foo() {
+               class test2 {
+               }
+       }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Class declarations may not be nested in %s on line %d
diff --git a/Zend/tests/errmsg_028.phpt b/Zend/tests/errmsg_028.phpt
new file mode 100644 (file)
index 0000000..3331cb3
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+errmsg: cannot use 'self' as class name
+--FILE--
+<?php
+
+class self {
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot use 'self' as class name as it is reserved in %s on line %d
diff --git a/Zend/tests/errmsg_029.phpt b/Zend/tests/errmsg_029.phpt
new file mode 100644 (file)
index 0000000..73b85ce
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+errmsg: cannot use 'parent' as class name
+--FILE--
+<?php
+
+class parent {
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot use 'parent' as class name as it is reserved in %s on line %d
diff --git a/Zend/tests/errmsg_030.phpt b/Zend/tests/errmsg_030.phpt
new file mode 100644 (file)
index 0000000..ab6ccbd
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+errmsg: cannot use 'self' as parent class name
+--FILE--
+<?php
+
+class test extends self {
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot use 'self' as class name as it is reserved in %s on line %d
diff --git a/Zend/tests/errmsg_031.phpt b/Zend/tests/errmsg_031.phpt
new file mode 100644 (file)
index 0000000..6e35648
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+errmsg: cannot use 'parent' as parent class name
+--FILE--
+<?php
+
+class test extends parent {
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot use 'parent' as class name as it is reserved in %s on line %d
diff --git a/Zend/tests/errmsg_032.phpt b/Zend/tests/errmsg_032.phpt
new file mode 100644 (file)
index 0000000..6e34604
--- /dev/null
@@ -0,0 +1,15 @@
+--TEST--
+errmsg: __construct() cannot be static
+--FILE--
+<?php
+
+class test {
+
+       static function __construct() {
+       }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Constructor test::__construct() cannot be static in %s on line %d
diff --git a/Zend/tests/errmsg_033.phpt b/Zend/tests/errmsg_033.phpt
new file mode 100644 (file)
index 0000000..9693890
--- /dev/null
@@ -0,0 +1,15 @@
+--TEST--
+errmsg: __destruct() cannot be static
+--FILE--
+<?php
+
+class test {
+
+       static function __destruct() {
+       }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Destructor test::__destruct() cannot be static in %s on line %d
diff --git a/Zend/tests/errmsg_034.phpt b/Zend/tests/errmsg_034.phpt
new file mode 100644 (file)
index 0000000..1494fe5
--- /dev/null
@@ -0,0 +1,15 @@
+--TEST--
+errmsg: __clone() cannot be static
+--FILE--
+<?php
+
+class test {
+
+       static function __clone() {
+       }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Clone method test::__clone() cannot be static in %s on line %d
diff --git a/Zend/tests/errmsg_035.phpt b/Zend/tests/errmsg_035.phpt
new file mode 100644 (file)
index 0000000..76cbe3d
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+errmsg: cannot use 'self' as interface name
+--FILE--
+<?php
+
+class test implements self {
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot use 'self' as interface name as it is reserved in %s on line %d
diff --git a/Zend/tests/errmsg_036.phpt b/Zend/tests/errmsg_036.phpt
new file mode 100644 (file)
index 0000000..d1f4274
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+errmsg: cannot use 'parent' as interface name
+--FILE--
+<?php
+
+class test implements parent {
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot use 'parent' as interface name as it is reserved in %s on line %d
diff --git a/Zend/tests/errmsg_037.phpt b/Zend/tests/errmsg_037.phpt
new file mode 100644 (file)
index 0000000..6b98bb3
--- /dev/null
@@ -0,0 +1,13 @@
+--TEST--
+errmsg: properties cannot be abstract
+--FILE--
+<?php
+
+class test {
+       abstract $var = 1;
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Properties cannot be declared abstract in %s on line %d
diff --git a/Zend/tests/errmsg_038.phpt b/Zend/tests/errmsg_038.phpt
new file mode 100644 (file)
index 0000000..fdab803
--- /dev/null
@@ -0,0 +1,13 @@
+--TEST--
+errmsg: properties cannot be final
+--FILE--
+<?php
+
+class test {
+       final $var = 1;
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot declare property test::$var final, the final modifier is allowed only for methods in %s on line %d
diff --git a/Zend/tests/errmsg_039.phpt b/Zend/tests/errmsg_039.phpt
new file mode 100644 (file)
index 0000000..0000811
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+errmsg: cannot redeclare property
+--FILE--
+<?php
+
+class test {
+       var $var;
+       var $var;
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot redeclare test::$var in %s on line %d
diff --git a/Zend/tests/errmsg_040.phpt b/Zend/tests/errmsg_040.phpt
new file mode 100644 (file)
index 0000000..f3d0afc
--- /dev/null
@@ -0,0 +1,13 @@
+--TEST--
+errmsg: arrays are not allowed in class constants
+--FILE--
+<?php
+
+class test {
+       const TEST = array(1,2,3);
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Arrays are not allowed in class constants in %s on line %d
diff --git a/Zend/tests/errmsg_041.phpt b/Zend/tests/errmsg_041.phpt
new file mode 100644 (file)
index 0000000..bfcafd2
--- /dev/null
@@ -0,0 +1,11 @@
+--TEST--
+errmsg: instanceof expects an object instance, constant given
+--FILE--
+<?php
+
+var_dump("abc" instanceof stdclass);
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: instanceof expects an object instance, constant given in %s on line %d
diff --git a/Zend/tests/errmsg_042.phpt b/Zend/tests/errmsg_042.phpt
new file mode 100644 (file)
index 0000000..3b4ea7c
--- /dev/null
@@ -0,0 +1,13 @@
+--TEST--
+errmsg: key element cannot be a reference
+--FILE--
+<?php
+
+$a = array(1,2,3);
+foreach ($a as &$k=>$v) {
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Key element cannot be a reference in %s on line %d
diff --git a/Zend/tests/errmsg_043.phpt b/Zend/tests/errmsg_043.phpt
new file mode 100644 (file)
index 0000000..3de8bc2
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+errmsg: cannot create references to temp array
+--FILE--
+<?php
+
+foreach (array(1,2,3) as $k=>&$v) {
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Fatal error: Cannot create references to elements of a temporary array expression in %s on line %d
diff --git a/Zend/tests/globals.inc b/Zend/tests/globals.inc
new file mode 100644 (file)
index 0000000..976237c
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+var_dump(isset($_SERVER));
+var_dump(empty($_SERVER));
+var_dump(gettype($_SERVER));
+var_dump(count($_SERVER));
+
+var_dump($_SERVER['PHP_SELF']);
+unset($_SERVER['PHP_SELF']);
+var_dump($_SERVER['PHP_SELF']);
+
+unset($_SERVER);
+var_dump($_SERVER);
+
+?>
diff --git a/Zend/tests/globals_001.phpt b/Zend/tests/globals_001.phpt
new file mode 100644 (file)
index 0000000..b678c53
--- /dev/null
@@ -0,0 +1,34 @@
+--TEST--
+globals in global scope 
+--INIT--
+variables_order="egpcs"
+--FILE--
+<?php
+
+var_dump(isset($_SERVER));
+var_dump(empty($_SERVER));
+var_dump(gettype($_SERVER));
+var_dump(count($_SERVER));
+
+var_dump($_SERVER['PHP_SELF']);
+unset($_SERVER['PHP_SELF']);
+var_dump($_SERVER['PHP_SELF']);
+
+unset($_SERVER);
+var_dump($_SERVER);
+
+echo "Done\n";
+?>
+--EXPECTF--    
+bool(true)
+bool(false)
+string(5) "array"
+int(%d)
+string(%d) "%s"
+
+Notice: Undefined index:  PHP_SELF in %s on line %d
+NULL
+
+Notice: Undefined variable: _SERVER in %s on line %d
+NULL
+Done
diff --git a/Zend/tests/globals_002.phpt b/Zend/tests/globals_002.phpt
new file mode 100644 (file)
index 0000000..3bc3dae
--- /dev/null
@@ -0,0 +1,37 @@
+--TEST--
+globals in local scope
+--INIT--
+variables_order="egpcs"
+--FILE--
+<?php
+function test() {
+       var_dump(isset($_SERVER));
+       var_dump(empty($_SERVER));
+       var_dump(gettype($_SERVER));
+       var_dump(count($_SERVER));
+
+       var_dump($_SERVER['PHP_SELF']);
+       unset($_SERVER['PHP_SELF']);
+       var_dump($_SERVER['PHP_SELF']);
+
+       unset($_SERVER);
+       var_dump($_SERVER);
+}
+
+test();
+
+echo "Done\n";
+?>
+--EXPECTF--    
+bool(true)
+bool(false)
+string(5) "array"
+int(%d)
+string(%d) "%s"
+
+Notice: Undefined index:  PHP_SELF in %s on line %d
+NULL
+
+Notice: Undefined variable: _SERVER in %s on line %d
+NULL
+Done
diff --git a/Zend/tests/globals_003.phpt b/Zend/tests/globals_003.phpt
new file mode 100644 (file)
index 0000000..dcc7935
--- /dev/null
@@ -0,0 +1,43 @@
+--TEST--
+globals in local scope - 2
+--INIT--
+variables_order="egpcs"
+--FILE--
+<?php
+
+class test {
+
+       static function bar() {
+
+               var_dump(isset($_SERVER));
+               var_dump(empty($_SERVER));
+               var_dump(gettype($_SERVER));
+               var_dump(count($_SERVER));
+
+               var_dump($_SERVER['PHP_SELF']);
+               unset($_SERVER['PHP_SELF']);
+               var_dump($_SERVER['PHP_SELF']);
+
+               unset($_SERVER);
+               var_dump($_SERVER);
+
+       }
+}
+
+test::bar();
+
+echo "Done\n";
+?>
+--EXPECTF--    
+bool(true)
+bool(false)
+string(5) "array"
+int(%d)
+string(%d) "%s"
+
+Notice: Undefined index:  PHP_SELF in %s on line %d
+NULL
+
+Notice: Undefined variable: _SERVER in %s on line %d
+NULL
+Done
diff --git a/Zend/tests/globals_004.phpt b/Zend/tests/globals_004.phpt
new file mode 100644 (file)
index 0000000..e06791e
--- /dev/null
@@ -0,0 +1,28 @@
+--TEST--
+globals in local scope - 3 
+--INIT--
+variables_order="egpcs"
+--FILE--
+<?php
+
+function test() {
+       include dirname(__FILE__)."/globals.inc";
+}
+
+test();
+
+echo "Done\n";
+?>
+--EXPECTF--    
+bool(true)
+bool(false)
+string(5) "array"
+int(%d)
+string(%d) "%s"
+
+Notice: Undefined index:  PHP_SELF in %s on line %d
+NULL
+
+Notice: Undefined variable: _SERVER in %s on line %d
+NULL
+Done