summaryrefslogtreecommitdiff
path: root/Zend/tests/return_types
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/return_types')
-rw-r--r--Zend/tests/return_types/001.phpt2
-rw-r--r--Zend/tests/return_types/002.phpt2
-rw-r--r--Zend/tests/return_types/003.phpt2
-rw-r--r--Zend/tests/return_types/004.phpt2
-rw-r--r--Zend/tests/return_types/005.phpt2
-rw-r--r--Zend/tests/return_types/006.phpt2
-rw-r--r--Zend/tests/return_types/007.phpt2
-rw-r--r--Zend/tests/return_types/008.phpt2
-rw-r--r--Zend/tests/return_types/009.phpt2
-rw-r--r--Zend/tests/return_types/010.phpt2
-rw-r--r--Zend/tests/return_types/011.phpt2
-rw-r--r--Zend/tests/return_types/012.phpt2
-rw-r--r--Zend/tests/return_types/013.phpt2
-rw-r--r--Zend/tests/return_types/014.phpt2
-rw-r--r--Zend/tests/return_types/015.phpt2
-rw-r--r--Zend/tests/return_types/016.phpt2
-rw-r--r--Zend/tests/return_types/017.phpt2
-rw-r--r--Zend/tests/return_types/018.phpt2
-rw-r--r--Zend/tests/return_types/019.phpt2
-rw-r--r--Zend/tests/return_types/020.phpt2
-rw-r--r--Zend/tests/return_types/021.phpt2
-rw-r--r--Zend/tests/return_types/022.phpt2
-rw-r--r--Zend/tests/return_types/023.phpt2
-rw-r--r--Zend/tests/return_types/024.phpt2
-rw-r--r--Zend/tests/return_types/025.phpt2
-rw-r--r--Zend/tests/return_types/026.phpt1
-rw-r--r--Zend/tests/return_types/027.phpt1
-rw-r--r--Zend/tests/return_types/031.phpt2
-rw-r--r--Zend/tests/return_types/generators001.phpt2
-rw-r--r--Zend/tests/return_types/generators002.phpt2
-rw-r--r--Zend/tests/return_types/generators003.phpt2
-rw-r--r--Zend/tests/return_types/generators004.phpt2
-rw-r--r--Zend/tests/return_types/generators005.phpt2
-rw-r--r--Zend/tests/return_types/inheritance001.phpt2
-rw-r--r--Zend/tests/return_types/inheritance002.phpt2
-rw-r--r--Zend/tests/return_types/inheritance003.phpt2
-rw-r--r--Zend/tests/return_types/inheritance004.phpt2
-rw-r--r--Zend/tests/return_types/inheritance005.phpt2
-rw-r--r--Zend/tests/return_types/inheritance006.phpt3
-rw-r--r--Zend/tests/return_types/inheritance007.phpt3
-rw-r--r--Zend/tests/return_types/inheritance008.phpt3
-rw-r--r--Zend/tests/return_types/inheritance009.phpt3
-rw-r--r--Zend/tests/return_types/reflection001.phpt1
-rw-r--r--Zend/tests/return_types/return_reference_separation.phpt3
-rw-r--r--Zend/tests/return_types/rfc001.phpt2
-rw-r--r--Zend/tests/return_types/rfc002.phpt2
-rw-r--r--Zend/tests/return_types/rfc003.phpt2
-rw-r--r--Zend/tests/return_types/rfc004.phpt2
48 files changed, 2 insertions, 96 deletions
diff --git a/Zend/tests/return_types/001.phpt b/Zend/tests/return_types/001.phpt
index 13bf93f4df..2b87a562f6 100644
--- a/Zend/tests/return_types/001.phpt
+++ b/Zend/tests/return_types/001.phpt
@@ -1,13 +1,11 @@
--TEST--
Returned nothing, expected array
-
--FILE--
<?php
function test1() : array {
}
test1();
-
--EXPECTF--
Fatal error: Uncaught TypeError: Return value of test1() must be of the type array, none returned in %s:%d
Stack trace:
diff --git a/Zend/tests/return_types/002.phpt b/Zend/tests/return_types/002.phpt
index 5921634553..615317cf83 100644
--- a/Zend/tests/return_types/002.phpt
+++ b/Zend/tests/return_types/002.phpt
@@ -1,6 +1,5 @@
--TEST--
Returned null, expected array
-
--FILE--
<?php
function test1() : array {
@@ -8,7 +7,6 @@ function test1() : array {
}
test1();
-
--EXPECTF--
Fatal error: Uncaught TypeError: Return value of test1() must be of the type array, null returned in %s:%d
Stack trace:
diff --git a/Zend/tests/return_types/003.phpt b/Zend/tests/return_types/003.phpt
index e12e215de2..676d668cb8 100644
--- a/Zend/tests/return_types/003.phpt
+++ b/Zend/tests/return_types/003.phpt
@@ -1,13 +1,11 @@
--TEST--
Returned 1, expected array
-
--FILE--
<?php
function test1() : array {
return 1;
}
test1();
-
--EXPECTF--
Fatal error: Uncaught TypeError: Return value of test1() must be of the type array, integer returned in %s:%d
Stack trace:
diff --git a/Zend/tests/return_types/004.phpt b/Zend/tests/return_types/004.phpt
index 7865eb9d4d..6098d51334 100644
--- a/Zend/tests/return_types/004.phpt
+++ b/Zend/tests/return_types/004.phpt
@@ -1,6 +1,5 @@
--TEST--
Returned string, expected array
-
--FILE--
<?php
function test1() : array {
@@ -8,7 +7,6 @@ function test1() : array {
}
test1();
-
--EXPECTF--
Fatal error: Uncaught TypeError: Return value of test1() must be of the type array, string returned in %s:%d
Stack trace:
diff --git a/Zend/tests/return_types/005.phpt b/Zend/tests/return_types/005.phpt
index a114b3ee93..f8d666fae5 100644
--- a/Zend/tests/return_types/005.phpt
+++ b/Zend/tests/return_types/005.phpt
@@ -1,6 +1,5 @@
--TEST--
Return value fails inheritance check in method
-
--FILE--
<?php
class foo {}
@@ -13,7 +12,6 @@ class qux {
$qux = new qux();
$qux->foo();
-
--EXPECTF--
Fatal error: Uncaught TypeError: Return value of qux::foo() must be an instance of foo, instance of qux returned in %s:%d
Stack trace:
diff --git a/Zend/tests/return_types/006.phpt b/Zend/tests/return_types/006.phpt
index 359b25a28d..a4fcea1d25 100644
--- a/Zend/tests/return_types/006.phpt
+++ b/Zend/tests/return_types/006.phpt
@@ -1,6 +1,5 @@
--TEST--
Return type allowed in child when parent does not have return type
-
--FILE--
<?php
class Comment {}
@@ -15,7 +14,6 @@ $comments = new CommentsIterator([new Comment]);
foreach ($comments as $comment) {
var_dump($comment);
}
-
--EXPECTF--
object(Comment)#%d (%d) {
}
diff --git a/Zend/tests/return_types/007.phpt b/Zend/tests/return_types/007.phpt
index 0bbfb9fbba..21f7023518 100644
--- a/Zend/tests/return_types/007.phpt
+++ b/Zend/tests/return_types/007.phpt
@@ -1,6 +1,5 @@
--TEST--
Return value is subclass of return type
-
--FILE--
<?php
class foo {}
@@ -13,7 +12,6 @@ class qux extends foo {
$qux = new qux();
var_dump($qux->foo());
-
--EXPECTF--
object(qux)#%d (%d) {
}
diff --git a/Zend/tests/return_types/008.phpt b/Zend/tests/return_types/008.phpt
index 47343d0564..f2e01299de 100644
--- a/Zend/tests/return_types/008.phpt
+++ b/Zend/tests/return_types/008.phpt
@@ -1,6 +1,5 @@
--TEST--
Return type covariance in interface implementation
-
--FILE--
<?php
interface foo {
@@ -16,6 +15,5 @@ class qux implements foo {
$qux = new qux();
var_dump($qux->bar());
-
--EXPECTF--
Fatal error: Declaration of qux::bar(): qux must be compatible with foo::bar(): foo in %s008.php on line 7
diff --git a/Zend/tests/return_types/009.phpt b/Zend/tests/return_types/009.phpt
index b83703ede5..7eda8ce27b 100644
--- a/Zend/tests/return_types/009.phpt
+++ b/Zend/tests/return_types/009.phpt
@@ -1,6 +1,5 @@
--TEST--
Return type covariance error
-
--FILE--
<?php
interface foo {
@@ -14,6 +13,5 @@ class qux implements foo {
return $this;
}
}
-
--EXPECTF--
Fatal error: Declaration of qux::bar(): biz must be compatible with foo::bar(): foo in %s on line %d
diff --git a/Zend/tests/return_types/010.phpt b/Zend/tests/return_types/010.phpt
index 1a117d0cbc..2cfe97dac2 100644
--- a/Zend/tests/return_types/010.phpt
+++ b/Zend/tests/return_types/010.phpt
@@ -1,6 +1,5 @@
--TEST--
Returned null, expected array reference
-
--FILE--
<?php
function &foo(array &$in) : array {
@@ -9,7 +8,6 @@ function &foo(array &$in) : array {
$array = [1, 2, 3];
var_dump(foo($array));
-
--EXPECTF--
Fatal error: Uncaught TypeError: Return value of foo() must be of the type array, null returned in %s:%d
Stack trace:
diff --git a/Zend/tests/return_types/011.phpt b/Zend/tests/return_types/011.phpt
index f3b000a706..23dbc1cfdb 100644
--- a/Zend/tests/return_types/011.phpt
+++ b/Zend/tests/return_types/011.phpt
@@ -1,6 +1,5 @@
--TEST--
Function returned callable, expected callable
-
--FILE--
<?php
function foo() : callable {
@@ -8,7 +7,6 @@ function foo() : callable {
}
var_dump(foo());
-
--EXPECTF--
object(Closure)#%d (%d) {
}
diff --git a/Zend/tests/return_types/012.phpt b/Zend/tests/return_types/012.phpt
index 39fa8e0ec6..b4c02a8ec1 100644
--- a/Zend/tests/return_types/012.phpt
+++ b/Zend/tests/return_types/012.phpt
@@ -1,6 +1,5 @@
--TEST--
Method returned callable, expected callable
-
--FILE--
<?php
class foo {
@@ -14,7 +13,6 @@ class foo {
$baz = new foo();
var_dump($baz->bar());
-
--EXPECT--
object(Closure)#2 (2) {
["static"]=>
diff --git a/Zend/tests/return_types/013.phpt b/Zend/tests/return_types/013.phpt
index 673a8f9dbc..5b2c06748d 100644
--- a/Zend/tests/return_types/013.phpt
+++ b/Zend/tests/return_types/013.phpt
@@ -1,6 +1,5 @@
--TEST--
Closure inside method returned null, expected array
-
--FILE--
<?php
class foo {
@@ -14,7 +13,6 @@ class foo {
$baz = new foo();
var_dump($func=$baz->bar(), $func());
-
--EXPECTF--
Fatal error: Uncaught TypeError: Return value of foo::{closure}() must be of the type array, null returned in %s:%d
Stack trace:
diff --git a/Zend/tests/return_types/014.phpt b/Zend/tests/return_types/014.phpt
index abf8b1210b..468979d5d9 100644
--- a/Zend/tests/return_types/014.phpt
+++ b/Zend/tests/return_types/014.phpt
@@ -1,12 +1,10 @@
--TEST--
Constructors cannot declare a return type
-
--FILE--
<?php
class Foo {
function __construct() : Foo {}
}
-
--EXPECTF--
Fatal error: Constructor %s::%s() cannot declare a return type in %s on line %s
diff --git a/Zend/tests/return_types/015.phpt b/Zend/tests/return_types/015.phpt
index 1c2cd564ff..973956b6bc 100644
--- a/Zend/tests/return_types/015.phpt
+++ b/Zend/tests/return_types/015.phpt
@@ -1,6 +1,5 @@
--TEST--
Return types allowed in namespace
-
--FILE--
<?php
@@ -18,7 +17,6 @@ class Vector implements Collection {
$v = new Vector;
var_dump($v->values());
-
--EXPECTF--
object(Collections\Vector)#%d (%d) {
}
diff --git a/Zend/tests/return_types/016.phpt b/Zend/tests/return_types/016.phpt
index f3636751c1..cf31d96e6b 100644
--- a/Zend/tests/return_types/016.phpt
+++ b/Zend/tests/return_types/016.phpt
@@ -1,6 +1,5 @@
--TEST--
Fully qualified classes are allowed in return types
-
--FILE--
<?php
@@ -14,7 +13,6 @@ class Foo {
$foo = new Foo;
var_dump($foo->foo(new \EmptyIterator()));
-
--EXPECTF--
object(EmptyIterator)#%d (0) {
}
diff --git a/Zend/tests/return_types/017.phpt b/Zend/tests/return_types/017.phpt
index d44b26fc04..d45cb55d45 100644
--- a/Zend/tests/return_types/017.phpt
+++ b/Zend/tests/return_types/017.phpt
@@ -1,6 +1,5 @@
--TEST--
Fully qualified classes in trait return types
-
--FILE--
<?php
@@ -18,7 +17,6 @@ class Foo {
$foo = new Foo;
var_dump($foo->foo([]));
-
--EXPECTF--
object(EmptyIterator)#%d (%d) {
}
diff --git a/Zend/tests/return_types/018.phpt b/Zend/tests/return_types/018.phpt
index 6d6e0c7e73..4e93e70ea1 100644
--- a/Zend/tests/return_types/018.phpt
+++ b/Zend/tests/return_types/018.phpt
@@ -1,12 +1,10 @@
--TEST--
Destructors cannot declare a return type
-
--FILE--
<?php
class Foo {
function __destruct() : Foo {}
}
-
--EXPECTF--
Fatal error: Destructor %s::%s() cannot declare a return type in %s on line %s
diff --git a/Zend/tests/return_types/019.phpt b/Zend/tests/return_types/019.phpt
index cebf483285..f665ebde78 100644
--- a/Zend/tests/return_types/019.phpt
+++ b/Zend/tests/return_types/019.phpt
@@ -1,12 +1,10 @@
--TEST--
__clone cannot declare a return type
-
--FILE--
<?php
class Foo {
function __clone() : Foo {}
}
-
--EXPECTF--
Fatal error: %s::%s() cannot declare a return type in %s on line %s
diff --git a/Zend/tests/return_types/020.phpt b/Zend/tests/return_types/020.phpt
index 101de62dd7..57c93a8dcd 100644
--- a/Zend/tests/return_types/020.phpt
+++ b/Zend/tests/return_types/020.phpt
@@ -1,6 +1,5 @@
--TEST--
Exception thrown from function with return type
-
--FILE--
<?php
function test() : array {
@@ -8,7 +7,6 @@ function test() : array {
}
test();
-
--EXPECTF--
Fatal error: Uncaught Exception in %s:%d
Stack trace:
diff --git a/Zend/tests/return_types/021.phpt b/Zend/tests/return_types/021.phpt
index 051f7dce69..bd37df68f3 100644
--- a/Zend/tests/return_types/021.phpt
+++ b/Zend/tests/return_types/021.phpt
@@ -1,6 +1,5 @@
--TEST--
Return type allows self
-
--FILE--
<?php
class Foo {
@@ -13,7 +12,6 @@ class Bar extends Foo {}
var_dump(Foo::getInstance());
var_dump(Bar::getInstance());
-
--EXPECTF--
object(Foo)#%d (%d) {
}
diff --git a/Zend/tests/return_types/022.phpt b/Zend/tests/return_types/022.phpt
index 47cbb791df..cf5bb4f672 100644
--- a/Zend/tests/return_types/022.phpt
+++ b/Zend/tests/return_types/022.phpt
@@ -1,6 +1,5 @@
--TEST--
Hint on closure with lexical vars
-
--FILE--
<?php
$foo = "bar";
@@ -12,6 +11,5 @@ $test = function() use($foo) : Closure {
$callable = $test();
var_dump($callable());
-
--EXPECTF--
string(3) "bar"
diff --git a/Zend/tests/return_types/023.phpt b/Zend/tests/return_types/023.phpt
index 9e36bf7c04..70202bce58 100644
--- a/Zend/tests/return_types/023.phpt
+++ b/Zend/tests/return_types/023.phpt
@@ -1,13 +1,11 @@
--TEST--
PHP 4 Constructors cannot declare a return type
-
--FILE--
<?php
class Foo {
function foo() : Foo {}
}
-
--EXPECTF--
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Foo has a deprecated constructor in %s on line %d
diff --git a/Zend/tests/return_types/024.phpt b/Zend/tests/return_types/024.phpt
index 0579973fbc..45c8162335 100644
--- a/Zend/tests/return_types/024.phpt
+++ b/Zend/tests/return_types/024.phpt
@@ -1,10 +1,8 @@
--TEST--
Return type of self is not allowed in function
-
--FILE--
<?php
function test(): self {}
-
--EXPECTF--
Fatal error: Cannot use "self" when no class scope is active in %s on line 3
diff --git a/Zend/tests/return_types/025.phpt b/Zend/tests/return_types/025.phpt
index 148971250a..c9f0ffef4a 100644
--- a/Zend/tests/return_types/025.phpt
+++ b/Zend/tests/return_types/025.phpt
@@ -1,13 +1,11 @@
--TEST--
Return type of self is allowed in closure
-
--FILE--
<?php
$c = function(): self { return $this; };
class Bar { }
var_dump($c->call(new Bar));
-
--EXPECT--
object(Bar)#2 (0) {
}
diff --git a/Zend/tests/return_types/026.phpt b/Zend/tests/return_types/026.phpt
index 5693e95c7e..f08c527512 100644
--- a/Zend/tests/return_types/026.phpt
+++ b/Zend/tests/return_types/026.phpt
@@ -4,6 +4,5 @@ Return type of parent is not allowed in function
<?php
function test(): parent {}
-
--EXPECTF--
Fatal error: Cannot use "parent" when no class scope is active in %s on line %d
diff --git a/Zend/tests/return_types/027.phpt b/Zend/tests/return_types/027.phpt
index a5d2c321bf..33a9c7f94d 100644
--- a/Zend/tests/return_types/027.phpt
+++ b/Zend/tests/return_types/027.phpt
@@ -8,7 +8,6 @@ class B extends A {}
$c = function(parent $x): parent { return $x; };
var_dump($c->bindTo(null, 'B')(new A));
-
--EXPECTF--
object(A)#%d (0) {
}
diff --git a/Zend/tests/return_types/031.phpt b/Zend/tests/return_types/031.phpt
index 91ee2f8ce4..6d0b71b23b 100644
--- a/Zend/tests/return_types/031.phpt
+++ b/Zend/tests/return_types/031.phpt
@@ -11,4 +11,4 @@ class B extends A {
?>
DONE
--EXPECTF--
-Fatal error: Declaration of B::foo(): ?int must be compatible with A::foo(): int in %s031.php on line 7 \ No newline at end of file
+Fatal error: Declaration of B::foo(): ?int must be compatible with A::foo(): int in %s031.php on line 7
diff --git a/Zend/tests/return_types/generators001.phpt b/Zend/tests/return_types/generators001.phpt
index f2ac88a7ad..9f89d71102 100644
--- a/Zend/tests/return_types/generators001.phpt
+++ b/Zend/tests/return_types/generators001.phpt
@@ -1,6 +1,5 @@
--TEST--
Valid generator return types
-
--FILE--
<?php
function test1() : Generator {
@@ -20,7 +19,6 @@ var_dump(
test2(),
test3()
);
-
--EXPECTF--
object(Generator)#%d (%d) {
}
diff --git a/Zend/tests/return_types/generators002.phpt b/Zend/tests/return_types/generators002.phpt
index 519c97a962..90bada714b 100644
--- a/Zend/tests/return_types/generators002.phpt
+++ b/Zend/tests/return_types/generators002.phpt
@@ -1,11 +1,9 @@
--TEST--
Generator return type must be Generator, Iterator or Traversable
-
--FILE--
<?php
function test1() : StdClass {
yield 1;
}
-
--EXPECTF--
Fatal error: Generators may only declare a return type of Generator, Iterator, Traversable, or iterable, StdClass is not permitted in %s on line %d
diff --git a/Zend/tests/return_types/generators003.phpt b/Zend/tests/return_types/generators003.phpt
index 0ff2524f47..5502318e98 100644
--- a/Zend/tests/return_types/generators003.phpt
+++ b/Zend/tests/return_types/generators003.phpt
@@ -1,6 +1,5 @@
--TEST--
Return type covariance works with generators
-
--FILE--
<?php
interface Collection extends IteratorAggregate {
@@ -17,6 +16,5 @@ class SomeCollection implements Collection {
$some = new SomeCollection();
var_dump($some->getIterator());
-
--EXPECTF--
Fatal error: Declaration of SomeCollection::getIterator(): Generator must be compatible with Collection::getIterator(): Iterator in %sgenerators003.php on line 6
diff --git a/Zend/tests/return_types/generators004.phpt b/Zend/tests/return_types/generators004.phpt
index 74aa801638..4e9aa07f42 100644
--- a/Zend/tests/return_types/generators004.phpt
+++ b/Zend/tests/return_types/generators004.phpt
@@ -1,6 +1,5 @@
--TEST--
Generator with return type does not fail with empty return
-
--FILE--
<?php
@@ -12,6 +11,5 @@ $a = function(): \Iterator {
foreach($a() as $value) {
echo $value;
}
-
--EXPECT--
1
diff --git a/Zend/tests/return_types/generators005.phpt b/Zend/tests/return_types/generators005.phpt
index 21e6c4bef1..a7e3bda042 100644
--- a/Zend/tests/return_types/generators005.phpt
+++ b/Zend/tests/return_types/generators005.phpt
@@ -1,6 +1,5 @@
--TEST--
Return type covariance works with generators
-
--FILE--
<?php
interface Collection extends IteratorAggregate {
@@ -17,7 +16,6 @@ class SomeCollection implements Collection {
$some = new SomeCollection();
var_dump($some->getIterator());
-
--EXPECTF--
object(Generator)#%d (%d) {
}
diff --git a/Zend/tests/return_types/inheritance001.phpt b/Zend/tests/return_types/inheritance001.phpt
index 8e0523eb70..5e154d0482 100644
--- a/Zend/tests/return_types/inheritance001.phpt
+++ b/Zend/tests/return_types/inheritance001.phpt
@@ -1,6 +1,5 @@
--TEST--
Return type covariance; extends class
-
--FILE--
<?php
@@ -11,6 +10,5 @@ class A {
class B extends A {
function foo(): StdClass {}
}
-
--EXPECTF--
Fatal error: Declaration of B::foo(): StdClass must be compatible with A::foo(): A in %s on line %d
diff --git a/Zend/tests/return_types/inheritance002.phpt b/Zend/tests/return_types/inheritance002.phpt
index 8cb63b6fc8..bb00b7e243 100644
--- a/Zend/tests/return_types/inheritance002.phpt
+++ b/Zend/tests/return_types/inheritance002.phpt
@@ -1,6 +1,5 @@
--TEST--
Return type covariance; extends abstract class
-
--FILE--
<?php
@@ -11,6 +10,5 @@ abstract class A {
class B extends A {
function foo(): StdClass {}
}
-
--EXPECTF--
Fatal error: Declaration of B::foo(): StdClass must be compatible with A::foo(): A in %s on line %d
diff --git a/Zend/tests/return_types/inheritance003.phpt b/Zend/tests/return_types/inheritance003.phpt
index 0b22dd55d4..e8ebe90cd1 100644
--- a/Zend/tests/return_types/inheritance003.phpt
+++ b/Zend/tests/return_types/inheritance003.phpt
@@ -1,6 +1,5 @@
--TEST--
Return type mismatch; implements interface
-
--FILE--
<?php
@@ -11,6 +10,5 @@ interface A {
class B implements A {
function foo(): StdClass {}
}
-
--EXPECTF--
Fatal error: Declaration of B::foo(): StdClass must be compatible with A::foo(): A in %s on line %d
diff --git a/Zend/tests/return_types/inheritance004.phpt b/Zend/tests/return_types/inheritance004.phpt
index 66d35564f7..1c8d685a63 100644
--- a/Zend/tests/return_types/inheritance004.phpt
+++ b/Zend/tests/return_types/inheritance004.phpt
@@ -1,6 +1,5 @@
--TEST--
Internal covariant return type of self
-
--FILE--
<?php
class Foo {
@@ -17,7 +16,6 @@ class Bar extends Foo {
var_dump(Bar::test());
var_dump(Foo::test());
-
--EXPECTF--
object(Bar)#%d (0) {
}
diff --git a/Zend/tests/return_types/inheritance005.phpt b/Zend/tests/return_types/inheritance005.phpt
index 31e0e11dd8..7415a72b9f 100644
--- a/Zend/tests/return_types/inheritance005.phpt
+++ b/Zend/tests/return_types/inheritance005.phpt
@@ -1,6 +1,5 @@
--TEST--
Internal covariant return type of self
-
--FILE--
<?php
class Foo {
@@ -14,6 +13,5 @@ class Bar extends Foo {
return new Bar;
}
}
-
--EXPECTF--
Fatal error: Declaration of Bar::test(): Bar must be compatible with Foo::test(): Foo in %sinheritance005.php on line 12
diff --git a/Zend/tests/return_types/inheritance006.phpt b/Zend/tests/return_types/inheritance006.phpt
index 86c11aa57a..7d4bcbe57b 100644
--- a/Zend/tests/return_types/inheritance006.phpt
+++ b/Zend/tests/return_types/inheritance006.phpt
@@ -1,9 +1,7 @@
--TEST--
External covariant return type of self
-
--INI--
opcache.enable_cli=1
-
--FILE--
<?php
require __DIR__ . "/classes.php.inc";
@@ -19,6 +17,5 @@ class Bar extends Foo {
return new B;
}
}
-
--EXPECTF--
Fatal error: Declaration of Bar::test(): B must be compatible with Foo::test(): A in %sinheritance006.php on line 14
diff --git a/Zend/tests/return_types/inheritance007.phpt b/Zend/tests/return_types/inheritance007.phpt
index 86d0bd9d69..af1738f807 100644
--- a/Zend/tests/return_types/inheritance007.phpt
+++ b/Zend/tests/return_types/inheritance007.phpt
@@ -1,9 +1,7 @@
--TEST--
Inheritance Hinting Compile Checking Failure Internal Classes
-
--INI--
opcache.enable_cli=1
-
--FILE--
<?php
class Foo {
@@ -17,6 +15,5 @@ class Bar extends Foo {
return new ArrayObject([1, 2]);
}
}
-
--EXPECTF--
Fatal error: Declaration of Bar::test(): ArrayObject must be compatible with Foo::test(): Traversable in %sinheritance007.php on line 12
diff --git a/Zend/tests/return_types/inheritance008.phpt b/Zend/tests/return_types/inheritance008.phpt
index 242c50dcf0..df353cda05 100644
--- a/Zend/tests/return_types/inheritance008.phpt
+++ b/Zend/tests/return_types/inheritance008.phpt
@@ -1,9 +1,7 @@
--TEST--
External covariant return type of self
-
--INI--
opcache.enable_cli=1
-
--FILE--
<?php
require __DIR__ . "/classes.php.inc";
@@ -22,7 +20,6 @@ class Bar extends Foo {
var_dump(Bar::test());
var_dump(Foo::test());
-
--EXPECTF--
object(B)#%d (0) {
}
diff --git a/Zend/tests/return_types/inheritance009.phpt b/Zend/tests/return_types/inheritance009.phpt
index 382007e8f0..b7d5628e8d 100644
--- a/Zend/tests/return_types/inheritance009.phpt
+++ b/Zend/tests/return_types/inheritance009.phpt
@@ -1,9 +1,7 @@
--TEST--
Inheritance Hinting Compile Checking Failure Internal Classes
-
--INI--
opcache.enable_cli=1
-
--FILE--
<?php
class Foo {
@@ -20,7 +18,6 @@ class Bar extends Foo {
var_dump(Bar::test());
var_dump(Foo::test());
-
--EXPECTF--
object(ArrayObject)#%d (1) {
["storage":"ArrayObject":private]=>
diff --git a/Zend/tests/return_types/reflection001.phpt b/Zend/tests/return_types/reflection001.phpt
index c95f7292b5..4c84b6524f 100644
--- a/Zend/tests/return_types/reflection001.phpt
+++ b/Zend/tests/return_types/reflection001.phpt
@@ -41,4 +41,3 @@ Class [ <user> class A ] {
}
}
}
-
diff --git a/Zend/tests/return_types/return_reference_separation.phpt b/Zend/tests/return_types/return_reference_separation.phpt
index 2ec0939088..ae7312b591 100644
--- a/Zend/tests/return_types/return_reference_separation.phpt
+++ b/Zend/tests/return_types/return_reference_separation.phpt
@@ -1,6 +1,5 @@
--TEST--
Return value separation
-
--FILE--
<?php
function test1(&$abc) : string {
@@ -31,4 +30,4 @@ int(123)
string(3) "123"
int(123)
string(3) "123"
-string(3) "123" \ No newline at end of file
+string(3) "123"
diff --git a/Zend/tests/return_types/rfc001.phpt b/Zend/tests/return_types/rfc001.phpt
index 5a1d42b446..6a17525b72 100644
--- a/Zend/tests/return_types/rfc001.phpt
+++ b/Zend/tests/return_types/rfc001.phpt
@@ -1,6 +1,5 @@
--TEST--
RFC example: returned type does not match the type declaration
-
--FILE--
<?php
@@ -9,7 +8,6 @@ function get_config(): array {
}
get_config();
-
--EXPECTF--
Fatal error: Uncaught TypeError: Return value of get_config() must be of the type array, integer returned in %s:%d
Stack trace:
diff --git a/Zend/tests/return_types/rfc002.phpt b/Zend/tests/return_types/rfc002.phpt
index 2f3ff02b1c..d7c7d28fd0 100644
--- a/Zend/tests/return_types/rfc002.phpt
+++ b/Zend/tests/return_types/rfc002.phpt
@@ -1,6 +1,5 @@
--TEST--
RFC example: Scalar Types
-
--FILE--
<?php
function answer(): int {
@@ -8,6 +7,5 @@ function answer(): int {
}
var_dump(answer());
-
--EXPECTF--
int(42)
diff --git a/Zend/tests/return_types/rfc003.phpt b/Zend/tests/return_types/rfc003.phpt
index ae4c5b7f60..6b9cc81c69 100644
--- a/Zend/tests/return_types/rfc003.phpt
+++ b/Zend/tests/return_types/rfc003.phpt
@@ -1,6 +1,5 @@
--TEST--
RFC example: cannot return null with a return type declaration
-
--FILE--
<?php
function foo(): DateTime {
@@ -8,7 +7,6 @@ function foo(): DateTime {
}
foo();
-
--EXPECTF--
Fatal error: Uncaught TypeError: Return value of foo() must be an instance of DateTime, null returned in %s:%d
Stack trace:
diff --git a/Zend/tests/return_types/rfc004.phpt b/Zend/tests/return_types/rfc004.phpt
index 654fb92321..ed40e41b09 100644
--- a/Zend/tests/return_types/rfc004.phpt
+++ b/Zend/tests/return_types/rfc004.phpt
@@ -1,6 +1,5 @@
--TEST--
RFC example: missing return type on override
-
--FILE--
<?php
@@ -16,6 +15,5 @@ class UserGateway_MySql implements UserGateway {
return new User;
}
}
-
--EXPECTF--
Fatal error: Declaration of UserGateway_MySql::find($id) must be compatible with UserGateway::find($id): User in %s on line 9