Skip to content

Commit 2daa357

Browse files
committed
update test
1 parent be902fc commit 2daa357

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

Zend/tests/return_hint/006.phpt

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
--TEST--
2-
Basic return hints covariance
2+
Return type where none previously existed
3+
34
--FILE--
45
<?php
5-
class foo {}
6-
class bar extends foo {}
7-
class baz {}
86

9-
class qux extends baz {
10-
public function foo() : foo {
11-
return new bar();
12-
}
7+
class Comment {
138
}
149

15-
$qux = new qux();
16-
var_dump($qux->foo());
17-
?>
18-
--EXPECTF--
19-
object(bar)#%d (%d) {
10+
class CommentsIterator extends ArrayIterator implements Iterator {
11+
function current() : Comment {
12+
return parent::current();
13+
}
2014
}
2115

2216

17+
$comments = new CommentsIterator([
18+
new Comment
19+
]);
20+
21+
foreach ($comments as $comment) {
22+
var_dump($comment);
23+
}
24+
--EXPECTF--
25+
object(Comment)#%d (%d) {
26+
}
27+

0 commit comments

Comments
 (0)