Skip to content

Commit 218d03d

Browse files
committed
change test override_static_type_with_self_in_final_class.phpt
1 parent 27f8e02 commit 218d03d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Zend/tests/type_declarations/override_static_type_with_self_in_final_class.phpt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,37 @@ final class Foo extends B implements A
3838
}
3939
}
4040

41+
final class Bar extends B implements A
42+
{
43+
use C;
44+
45+
public function method1(): Bar
46+
{
47+
return $this;
48+
}
49+
50+
public function method2(): Bar
51+
{
52+
return $this;
53+
}
54+
55+
public function method3(): Bar
56+
{
57+
return $this;
58+
}
59+
}
60+
4161
$foo = new Foo();
4262

4363
var_dump($foo->method1());
4464
var_dump($foo->method2());
4565
var_dump($foo->method3());
66+
67+
$bar = new Bar();
68+
69+
var_dump($bar->method1());
70+
var_dump($bar->method2());
71+
var_dump($bar->method3());
4672
?>
4773
--EXPECT--
4874
object(Foo)#1 (0) {
@@ -51,3 +77,9 @@ object(Foo)#1 (0) {
5177
}
5278
object(Foo)#1 (0) {
5379
}
80+
object(Bar)#2 (0) {
81+
}
82+
object(Bar)#2 (0) {
83+
}
84+
object(Bar)#2 (0) {
85+
}

0 commit comments

Comments
 (0)