File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -1629,6 +1629,7 @@ public function getMethodProperties($stackPtr)
1629
1629
T_CALLABLE => T_CALLABLE ,
1630
1630
T_SELF => T_SELF ,
1631
1631
T_PARENT => T_PARENT ,
1632
+ T_STATIC => T_STATIC ,
1632
1633
T_NS_SEPARATOR => T_NS_SEPARATOR ,
1633
1634
];
1634
1635
Original file line number Diff line number Diff line change @@ -66,3 +66,10 @@ $result = array_map(
66
66
static fn (int $ number ) : int => $ number + 1 ,
67
67
$ numbers
68
68
);
69
+
70
+ class ReturnMe {
71
+ /* testReturnTypeStatic */
72
+ private function myFunction (): static {
73
+ return $ this ;
74
+ }
75
+ }
Original file line number Diff line number Diff line change @@ -383,6 +383,29 @@ public function testArrowFunction()
383
383
}//end testArrowFunction()
384
384
385
385
386
+ /**
387
+ * Test a function with return type "static".
388
+ *
389
+ * @return void
390
+ */
391
+ public function testReturnTypeStatic ()
392
+ {
393
+ $ expected = [
394
+ 'scope ' => 'private ' ,
395
+ 'scope_specified ' => true ,
396
+ 'return_type ' => 'static ' ,
397
+ 'nullable_return_type ' => false ,
398
+ 'is_abstract ' => false ,
399
+ 'is_final ' => false ,
400
+ 'is_static ' => false ,
401
+ 'has_body ' => true ,
402
+ ];
403
+
404
+ $ this ->getMethodPropertiesTestHelper ('/* ' .__FUNCTION__ .' */ ' , $ expected );
405
+
406
+ }//end testReturnTypeStatic()
407
+
408
+
386
409
/**
387
410
* Test helper.
388
411
*
You can’t perform that action at this time.
0 commit comments