diff --git a/Zend/tests/031.phpt b/Zend/tests/031.phpt new file mode 100644 index 00000000000..8db52a5debb --- /dev/null +++ b/Zend/tests/031.phpt @@ -0,0 +1,11 @@ +--TEST-- +Testing array with '[]' passed as argument by value +--FILE-- + +--EXPECTF-- +Fatal error: Cannot use [] for reading in %s on line %d diff --git a/Zend/tests/032.phpt b/Zend/tests/032.phpt new file mode 100644 index 00000000000..8f7f9946473 --- /dev/null +++ b/Zend/tests/032.phpt @@ -0,0 +1,13 @@ +--TEST-- +Testing array with '[]' passed as argument by reference +--FILE-- + +--EXPECT-- +ok! diff --git a/Zend/tests/033.phpt b/Zend/tests/033.phpt new file mode 100644 index 00000000000..c8651159a66 --- /dev/null +++ b/Zend/tests/033.phpt @@ -0,0 +1,31 @@ +--TEST-- +Using undefined multidimensional array +--FILE-- +foo; + +$arr[1][2][3][4][5]->foo = 1; + +$arr[][] = 2; + +$arr[][]->bar = 2; + +?> +--EXPECTF-- + +Notice: Undefined variable: arr in %s on line %d + +Notice: Undefined variable: arr in %s on line %d + +Notice: Undefined variable: arr in %s on line %d + +Notice: Trying to get property of non-object in %s on line %d + +Strict Standards: Creating default object from empty value in %s on line %d + +Strict Standards: Creating default object from empty value in %s on line %d diff --git a/Zend/tests/anonymous_func_001.phpt b/Zend/tests/anonymous_func_001.phpt new file mode 100644 index 00000000000..644a7f49adb --- /dev/null +++ b/Zend/tests/anonymous_func_001.phpt @@ -0,0 +1,35 @@ +--TEST-- +Testing calls to anonymous function +--FILE-- + +--EXPECT-- +int(0) +int(0) +int(1) +int(1) +int(2) +int(2) +int(3) +int(3) +int(4) +int(4) +int(5) +int(5) +int(6) +int(6) +int(7) +int(7) +int(8) +int(8) +int(9) +int(9) diff --git a/Zend/tests/anonymous_func_002.phpt b/Zend/tests/anonymous_func_002.phpt new file mode 100644 index 00000000000..4c40b62300b --- /dev/null +++ b/Zend/tests/anonymous_func_002.phpt @@ -0,0 +1,16 @@ +--TEST-- +Testing anonymous function return as array key and accessing $GLOBALS +--FILE-- + +--EXPECT-- +int(2) +bool(true) diff --git a/Zend/tests/anonymous_func_003.phpt b/Zend/tests/anonymous_func_003.phpt new file mode 100644 index 00000000000..32c5cf085c8 --- /dev/null +++ b/Zend/tests/anonymous_func_003.phpt @@ -0,0 +1,15 @@ +--TEST-- +Using throw $var with anonymous function return +--FILE-- +getMessage() == 'test'); +} + +?> +--EXPECT-- +bool(true) diff --git a/Zend/tests/dynamic_call_001.phpt b/Zend/tests/dynamic_call_001.phpt new file mode 100644 index 00000000000..94e4203caff --- /dev/null +++ b/Zend/tests/dynamic_call_001.phpt @@ -0,0 +1,17 @@ +--TEST-- +Testing dynamic call to constructor (old-style) +--FILE-- + +--EXPECTF-- +Fatal error: Non-static method foo::foo() cannot be called statically in %s on line %d diff --git a/Zend/tests/dynamic_call_002.phpt b/Zend/tests/dynamic_call_002.phpt new file mode 100644 index 00000000000..dcb15296927 --- /dev/null +++ b/Zend/tests/dynamic_call_002.phpt @@ -0,0 +1,12 @@ +--TEST-- +Testing dynamic call with invalid value for method name +--FILE-- + +--EXPECTF-- +Fatal error: Function name must be a string in %s on line %d diff --git a/Zend/tests/dynamic_call_003.phpt b/Zend/tests/dynamic_call_003.phpt new file mode 100644 index 00000000000..15b830ec684 --- /dev/null +++ b/Zend/tests/dynamic_call_003.phpt @@ -0,0 +1,13 @@ +--TEST-- +Testing dynamic call with invalid method name +--FILE-- + +--EXPECTF-- +Fatal error: Function name must be a string in %s on line %d diff --git a/Zend/tests/dynamic_call_004.phpt b/Zend/tests/dynamic_call_004.phpt new file mode 100644 index 00000000000..6e833035a60 --- /dev/null +++ b/Zend/tests/dynamic_call_004.phpt @@ -0,0 +1,12 @@ +--TEST-- +Testing dynamic call with undefined variables +--FILE-- + +--EXPECTF-- +Notice: Undefined variable: a in %s on line %d + +Fatal error: Class name must be a valid object or a string in %s on line %d diff --git a/Zend/tests/exception_001.phpt b/Zend/tests/exception_001.phpt new file mode 100644 index 00000000000..ab74a920e78 --- /dev/null +++ b/Zend/tests/exception_001.phpt @@ -0,0 +1,38 @@ +--TEST-- +Testing nested exceptions +--FILE-- +getMessage()); + throw $e; + } + } catch (Exception $e) { + var_dump($e->getMessage()); + throw $e; + } + } catch (Exception $e) { + var_dump($e->getMessage()); + throw $e; + } +} catch (Exception $e) { + var_dump($e->getMessage()); + throw $e; +} + +?> +--EXPECTF-- +string(0) "" +string(0) "" +string(0) "" +string(0) "" + +Fatal error: Uncaught exception 'Exception' in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d diff --git a/Zend/tests/exception_002.phpt b/Zend/tests/exception_002.phpt new file mode 100644 index 00000000000..25f0c61f9d2 --- /dev/null +++ b/Zend/tests/exception_002.phpt @@ -0,0 +1,19 @@ +--TEST-- +Testing exception and GOTO +--FILE-- + +--EXPECT-- +2 diff --git a/Zend/tests/exception_003.phpt b/Zend/tests/exception_003.phpt new file mode 100644 index 00000000000..e060aace05f --- /dev/null +++ b/Zend/tests/exception_003.phpt @@ -0,0 +1,14 @@ +--TEST-- +Throwing exception in global scope +--FILE-- + +--EXPECTF-- + +Fatal error: Uncaught exception 'Exception' with message '1' in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d diff --git a/Zend/tests/heredoc_015.phpt b/Zend/tests/heredoc_015.phpt new file mode 100644 index 00000000000..21658cf8a59 --- /dev/null +++ b/Zend/tests/heredoc_015.phpt @@ -0,0 +1,41 @@ +--TEST-- +Testing heredoc with escape sequences +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) diff --git a/Zend/tests/heredoc_016.phpt b/Zend/tests/heredoc_016.phpt new file mode 100644 index 00000000000..de00036ccd4 --- /dev/null +++ b/Zend/tests/heredoc_016.phpt @@ -0,0 +1,42 @@ +--TEST-- +Testing heredoc (double quotes) with escape sequences +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) diff --git a/Zend/tests/heredoc_017.phpt b/Zend/tests/heredoc_017.phpt new file mode 100644 index 00000000000..e0ffddf05f3 --- /dev/null +++ b/Zend/tests/heredoc_017.phpt @@ -0,0 +1,17 @@ +--TEST-- +Testinh heredoc syntax +--FILE-- + +--EXPECT-- +bool(true) diff --git a/Zend/tests/instanceof_001.phpt b/Zend/tests/instanceof_001.phpt new file mode 100644 index 00000000000..b88e174c160 --- /dev/null +++ b/Zend/tests/instanceof_001.phpt @@ -0,0 +1,29 @@ +--TEST-- +Testing instanceof operator with several operators +--FILE-- + +--EXPECTF-- +bool(true) +bool(true) +bool(true) +bool(true) +bool(false) + +Catchable fatal error: Object of class stdClass could not be converted to string in %s on line %d diff --git a/Zend/tests/instanceof_002.phpt b/Zend/tests/instanceof_002.phpt new file mode 100644 index 00000000000..d3f4a35358d --- /dev/null +++ b/Zend/tests/instanceof_002.phpt @@ -0,0 +1,33 @@ +--TEST-- +Testing instanceof operator with class and interface inheriteds +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +bool(false) +bool(true) +bool(true) +bool(true) diff --git a/Zend/tests/jump14.phpt b/Zend/tests/jump14.phpt new file mode 100644 index 00000000000..2cc6391ce98 --- /dev/null +++ b/Zend/tests/jump14.phpt @@ -0,0 +1,28 @@ +--TEST-- +Testing GOTO inside blocks +--FILE-- + +--EXPECT-- +Done! diff --git a/Zend/tests/list_003.phpt b/Zend/tests/list_003.phpt new file mode 100644 index 00000000000..4a509f6a828 --- /dev/null +++ b/Zend/tests/list_003.phpt @@ -0,0 +1,24 @@ +--TEST-- +list() with non-array +--FILE-- + +--EXPECT-- +NULL +NULL +NULL +NULL +NULL diff --git a/Zend/tests/list_004.phpt b/Zend/tests/list_004.phpt new file mode 100644 index 00000000000..862a4e43133 --- /dev/null +++ b/Zend/tests/list_004.phpt @@ -0,0 +1,21 @@ +--TEST-- +list() with array reference +--FILE-- + +--EXPECT-- +int(1) +array(2) { + [0]=> + int(2) + [1]=> + int(1) +} diff --git a/Zend/tests/list_005.phpt b/Zend/tests/list_005.phpt new file mode 100644 index 00000000000..4afc353b2f9 --- /dev/null +++ b/Zend/tests/list_005.phpt @@ -0,0 +1,47 @@ +--TEST-- +Testing list() with several variables +--FILE-- + +--EXPECTF-- +string(1) "f" +string(1) "o" +string(1) "o" +---- +NULL +NULL +NULL +---- + +Fatal error: Cannot use object of type stdClass as array in %s on line %d diff --git a/Zend/tests/nowdoc_016.phpt b/Zend/tests/nowdoc_016.phpt new file mode 100644 index 00000000000..01eea4e7515 --- /dev/null +++ b/Zend/tests/nowdoc_016.phpt @@ -0,0 +1,41 @@ +--TEST-- +Testing nowdocs with escape sequences +--FILE-- + +--EXPECT-- +int(0) +int(1) +int(2) +int(2) +int(3) diff --git a/Zend/tests/nowdoc_017.phpt b/Zend/tests/nowdoc_017.phpt new file mode 100644 index 00000000000..5d29a86ba81 --- /dev/null +++ b/Zend/tests/nowdoc_017.phpt @@ -0,0 +1,16 @@ +--TEST-- +Testing nowdoc in default value for property +--FILE-- + +--EXPECT-- +ok! diff --git a/Zend/tests/objects_022.phpt b/Zend/tests/objects_022.phpt new file mode 100644 index 00000000000..5a80e0a4110 --- /dev/null +++ b/Zend/tests/objects_022.phpt @@ -0,0 +1,39 @@ +--TEST-- +Testing 'self', 'parent' as type-hint +--FILE-- +testFoo(new foo); +$foo->testBar(new bar); +$foo->testBaz(new baz); +$foo->testFoo(new stdClass); // Catchable fatal error + +?> +--EXPECTF-- +object(foo)#%d (0) { +} +object(bar)#%d (0) { +} +object(baz)#%d (0) { +} + +Catchable fatal error: Argument 1 passed to foo::testFoo() must be an instance of foo, instance of stdClass given, called in %s on line %d and defined in %s on line %d diff --git a/Zend/tests/objects_023.phpt b/Zend/tests/objects_023.phpt new file mode 100644 index 00000000000..042a20e9d8d --- /dev/null +++ b/Zend/tests/objects_023.phpt @@ -0,0 +1,15 @@ +--TEST-- +Creating instances dynamically +--FILE-- + +--EXPECT-- +ok