We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ca6fcba + 82a55ff commit cf70177Copy full SHA for cf70177
Zend/tests/return_hint/016.phpt
@@ -0,0 +1,18 @@
1
+--TEST--
2
+Fully qualified classes are allowed in return types
3
+
4
+--FILE--
5
+<?php
6
7
+namespace Collections;
8
9
+class Foo {
10
+ function foo(\Iterator $i): \Iterator {
11
+ return $i;
12
+ }
13
+}
14
15
+$foo = new Foo;
16
+var_dump($foo->foo(new \EmptyIterator()));
17
18
+--EXPECTF--
Zend/tests/return_hint/017.phpt
@@ -0,0 +1,24 @@
+Fully qualified classes in trait return types
+namespace FooSpace;
+trait Fooable {
+ function foo(): \Iterator {
+ return new \EmptyIterator();
+ use Fooable;
19
20
+var_dump($foo->foo([]));
21
22
23
+object(EmptyIterator)#%d (%d) {
24
0 commit comments