Skip to content

Commit 81960a3

Browse files
committed
Merge pull request php#2 from morrisonlevi/returntypehinting
Added test for namespaced inheritance.
2 parents ed80c92 + 9afa196 commit 81960a3

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Zend/tests/return_hint/015.phpt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--TEST--
2+
Namespaced Inheritance
3+
4+
--FILE--
5+
<?php
6+
7+
namespace Collections;
8+
9+
interface Collection {
10+
function values(): Collection;
11+
}
12+
13+
class Vector implements Collection {
14+
function values(): Collection {
15+
return $this;
16+
}
17+
}
18+
19+
$v = new Vector;
20+
var_dump($v->values());
21+
22+
--EXPECTF--
23+
object(\Collections\Vector)#%d (%d) {
24+
}
25+
26+

0 commit comments

Comments
 (0)