diff --git a/tests/classes/type_hinting_001.phpt b/tests/classes/type_hinting_001.phpt deleted file mode 100644 index f1c1973cf3dc..000000000000 --- a/tests/classes/type_hinting_001.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -ZE2 class type hinting ---FILE-- -a($b); -$a->b($b); - -?> ---EXPECTF-- -Fatal error: Uncaught TypeError: FooBar::a(): Argument #1 ($foo) must be of type Foo, Blort given, called in %s on line 27 and defined in %s:12 -Stack trace: -#0 %s(%d): FooBar->a(Object(Blort)) -#1 {main} - thrown in %s on line 12 diff --git a/tests/classes/type_hinting_002.phpt b/tests/classes/type_hinting_002.phpt deleted file mode 100644 index 765de66bab0f..000000000000 --- a/tests/classes/type_hinting_002.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -ZE2 class type hinting non existing class ---FILE-- -a($o); -?> ---EXPECTF-- -Fatal error: Uncaught TypeError: Foo::a(): Argument #1 ($foo) must be of type NonExisting, Foo given, called in %s on line %d and defined in %s:%d -Stack trace: -#0 %s(%d): Foo->a(Object(Foo)) -#1 {main} - thrown in %s on line %d diff --git a/tests/classes/type_hinting_003.phpt b/tests/classes/type_hinting_003.phpt deleted file mode 100644 index 1c1f687c2c00..000000000000 --- a/tests/classes/type_hinting_003.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -ZE2 class type hinting with arrays ---FILE-- - ---EXPECTF-- -Deprecated: Test::f2(): Implicitly marking parameter $ar as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d -Test::f1() -array(1) { - [0]=> - int(42) -} -Test::f2() -NULL -Test::f2() -NULL -Test::f3() -array(0) { -} -Test::f4() -array(1) { - [0]=> - int(25) -} - -Fatal error: Uncaught TypeError: Test::f1(): Argument #1 ($ar) must be of type array, int given, called in %s on line %d and defined in %s:%d -Stack trace: -#0 %s(%d): Test::f1(1) -#1 {main} - thrown in %s on line %d diff --git a/tests/classes/type_hinting_004.phpt b/tests/classes/type_hinting_004.phpt deleted file mode 100644 index 99c11ebbaded..000000000000 --- a/tests/classes/type_hinting_004.phpt +++ /dev/null @@ -1,175 +0,0 @@ ---TEST-- -Ensure type hints are enforced for functions invoked as callbacks. ---FILE-- - Type hints with callback function:\n"; - class A { } - function f1(A $a) { - echo "in f1;\n"; - } - function f2(A $a = null) { - echo "in f2;\n"; - } - try { - call_user_func('f1', 1); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - try { - call_user_func('f1', new A); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - try { - call_user_func('f2', 1); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - try { - call_user_func('f2'); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - try { - call_user_func('f2', new A); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - try { - call_user_func('f2', null); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - - echo "\n\n---> Type hints with callback static method:\n"; - class C { - static function f1(A $a) { - if (isset($this)) { - echo "in C::f1 (instance);\n"; - } else { - echo "in C::f1 (static);\n"; - } - } - static function f2(A $a = null) { - if (isset($this)) { - echo "in C::f2 (instance);\n"; - } else { - echo "in C::f2 (static);\n"; - } - } - } - - try { - call_user_func(array('C', 'f1'), 1); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - try { - call_user_func(array('C', 'f1'), new A); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - try { - call_user_func(array('C', 'f2'), 1); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - try { - call_user_func(array('C', 'f2')); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - try { - call_user_func(array('C', 'f2'), new A); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - try { - call_user_func(array('C', 'f2'), null); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - - echo "\n\n---> Type hints with callback instance method:\n"; - class D { - function f1(A $a) { - if (isset($this)) { - echo "in C::f1 (instance);\n"; - } else { - echo "in C::f1 (static);\n"; - } - } - function f2(A $a = null) { - if (isset($this)) { - echo "in C::f2 (instance);\n"; - } else { - echo "in C::f2 (static);\n"; - } - } - } - $d = new D; - - try { - call_user_func(array($d, 'f1'), 1); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - try { - call_user_func(array($d, 'f1'), new A); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - try { - call_user_func(array($d, 'f2'), 1); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - try { - call_user_func(array($d, 'f2')); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - try { - call_user_func(array($d, 'f2'), new A); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - try { - call_user_func(array($d, 'f2'), null); - } catch (Error $ex) { - echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; - } - -?> ---EXPECTF-- -Deprecated: f2(): Implicitly marking parameter $a as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d - -Deprecated: C::f2(): Implicitly marking parameter $a as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d - -Deprecated: D::f2(): Implicitly marking parameter $a as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d ----> Type hints with callback function: -TypeError: 0: f1(): Argument #1 ($a) must be of type A, int given%s in %s on line %d -in f1; -TypeError: 0: f2(): Argument #1 ($a) must be of type ?A, int given%s in %s on line %d -in f2; -in f2; -in f2; - - ----> Type hints with callback static method: -TypeError: 0: C::f1(): Argument #1 ($a) must be of type A, int given%s in %s on line %d -in C::f1 (static); -TypeError: 0: C::f2(): Argument #1 ($a) must be of type ?A, int given%s in %s on line %d -in C::f2 (static); -in C::f2 (static); -in C::f2 (static); - - ----> Type hints with callback instance method: -TypeError: 0: D::f1(): Argument #1 ($a) must be of type A, int given%s in %s on line %d -in C::f1 (instance); -TypeError: 0: D::f2(): Argument #1 ($a) must be of type ?A, int given%s in %s on line %d -in C::f2 (instance); -in C::f2 (instance); -in C::f2 (instance); diff --git a/tests/classes/type_hinting_005a.phpt b/tests/classes/type_hinting_005a.phpt deleted file mode 100644 index 065ba70e8a5d..000000000000 --- a/tests/classes/type_hinting_005a.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Check type hint compatibility in overrides with array hints. ---FILE-- - ---EXPECTF-- -Fatal error: Declaration of D2::f(SomeClass $a) must be compatible with C::f(array $a) in %s on line 8 diff --git a/tests/classes/type_hinting_005c.phpt b/tests/classes/type_hinting_005c.phpt deleted file mode 100644 index 6cc3e3e369e0..000000000000 --- a/tests/classes/type_hinting_005c.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Check type hint compatibility in overrides with array hints. ---FILE-- - ---EXPECTF-- -Fatal error: Declaration of D::f(array $a) must be compatible with C::f(SomeClass $a) in %s on line 5 diff --git a/tests/classes/type_hinting_005d.phpt b/tests/classes/type_hinting_005d.phpt deleted file mode 100644 index 51c2a5a995ad..000000000000 --- a/tests/classes/type_hinting_005d.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Check type hint compatibility in overrides with array hints. ---FILE-- - ---EXPECTF-- -Fatal error: Declaration of D::f(array $a) must be compatible with C::f($a) in %s on line 5 diff --git a/tests/lang/type_hints_001.phpt b/tests/lang/type_hints_001.phpt deleted file mode 100644 index 293b469cd27e..000000000000 --- a/tests/lang/type_hints_001.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -ZE2 type hinting ---FILE-- - ---EXPECTF-- -Fatal error: Uncaught TypeError: type_hint_foo(): Argument #1 ($a) must be of type Foo, Bar given, called in %s on line 16 and defined in %s:9 -Stack trace: -#0 %s(%d): type_hint_foo(Object(Bar)) -#1 {main} - thrown in %s on line 9 diff --git a/tests/lang/type_hints_002.phpt b/tests/lang/type_hints_002.phpt deleted file mode 100644 index e3c327aab63c..000000000000 --- a/tests/lang/type_hints_002.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -ZE2 type hinting ---FILE-- -f(new P); -$o->f(); -$o->f(NULL); -?> ---EXPECTF-- -Deprecated: T::f(): Implicitly marking parameter $p as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d -object(P)#2 (0) { -} -- -NULL -- -NULL -- diff --git a/tests/lang/type_hints_003.phpt b/tests/lang/type_hints_003.phpt deleted file mode 100644 index 1a90940f424f..000000000000 --- a/tests/lang/type_hints_003.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -ZE2 type ---FILE-- - ---EXPECTF-- -Fatal error: Cannot use int as default value for parameter $p of type P in %s on line %d