Skip to content

Commit 207bf2a

Browse files
committed
Add reflection test
1 parent e7a9b81 commit 207bf2a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

ext/reflection/tests/static_type.phpt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
ReflectionType for static types
3+
--FILE--
4+
<?php
5+
6+
class A {
7+
public function test(): static {
8+
return new static;
9+
}
10+
}
11+
12+
$rm = new ReflectionMethod(A::class, 'test');
13+
$rt = $rm->getReturnType();
14+
// TODO: Should it be considered a builtin or not?
15+
var_dump($rt->isBuiltin());
16+
var_dump($rt->getName());
17+
var_dump((string) $rt);
18+
19+
?>
20+
--EXPECT--
21+
bool(true)
22+
string(6) "static"
23+
string(6) "static"

0 commit comments

Comments
 (0)