Skip to content

Commit 97e4f01

Browse files
committed
Test that static is allowed in final classes
1 parent add5617 commit 97e4f01

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
While it may not be very useful, static is also permitted in final classes
3+
--FILE--
4+
<?php
5+
6+
final class Test {
7+
public static function create(): static {
8+
return new static;
9+
}
10+
}
11+
12+
var_dump(Test::create());
13+
14+
?>
15+
--EXPECT--
16+
object(Test)#1 (0) {
17+
}

0 commit comments

Comments
 (0)