3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private static function fooPublic() { } public static function fooStatic() { } } $ref = new ReflectionClass('Foo'); //var_dump($ref->getMethods(ReflectionMethod::IS_PUBLIC)); var_dump(array_map(function(\ReflectionMethod $method) { return $method->getName(); }, $ref->getMethods(\ReflectionMethod::IS_STATIC)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JoYuq
function name:  (null)
number of ops:  16
compiled vars:  !0 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'ReflectionClass'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   18     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'array_map'
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FJoYuq%3A18%240'
          7        SEND_VAL                                                 ~4
          8        INIT_METHOD_CALL                                         !0, 'getMethods'
          9        SEND_VAL_EX                                              16
         10        DO_FCALL                                      0  $5      
         11        SEND_VAR                                                 $5
         12        DO_ICALL                                         $6      
         13        SEND_VAR                                                 $6
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FJoYuq%3A18%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JoYuq
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        INIT_METHOD_CALL                                         !0, 'getName'
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
          4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FJoYuq%3A18%240

Class Foo:
Function foopublic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JoYuq
function name:  fooPublic
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   null

End of function foopublic

Function foostatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JoYuq
function name:  fooStatic
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   null

End of function foostatic

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.78 ms | 1396 KiB | 17 Q