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)
16291629 T_CALLABLE => T_CALLABLE ,
16301630 T_SELF => T_SELF ,
16311631 T_PARENT => T_PARENT ,
1632+ T_STATIC => T_STATIC ,
16321633 T_NS_SEPARATOR => T_NS_SEPARATOR ,
16331634 ];
16341635
Original file line number Diff line number Diff line change @@ -66,3 +66,10 @@ $result = array_map(
6666 static fn (int $ number ) : int => $ number + 1 ,
6767 $ numbers
6868);
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()
383383 }//end testArrowFunction()
384384
385385
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+
386409 /**
387410 * Test helper.
388411 *
You can’t perform that action at this time.
0 commit comments