3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public function __construct(){ echo 'x'; } public function methodOne(){ echo 'y'; } public function methodTwo(){ echo 'z'; } } $classMethods = get_class_methods('MyClass'); // or $classMethods = get_class_methods(new MyClass()); foreach($classMethods as $method){ echo $method.'<br />'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/tVQPi
function name:  (null)
number of ops:  17
compiled vars:  !0 = $classMethods, !1 = $method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'get_class_methods'
          1        SEND_VAL                                                 'MyClass'
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
   20     4        INIT_FCALL                                               'get_class_methods'
          5        NEW                                              $4      'MyClass'
          6        DO_FCALL                                      0          
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !0, $6
   22    10      > FE_RESET_R                                       $8      !0, ->15
         11    > > FE_FETCH_R                                               $8, !1, ->15
   23    12    >   CONCAT                                           ~9      !1, '%3Cbr+%2F%3E'
         13        ECHO                                                     ~9
   22    14      > JMP                                                      ->11
         15    >   FE_FREE                                                  $8
   24    16      > RETURN                                                   1

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

End of function __construct

Function methodone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tVQPi
function name:  methodOne
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'y'
   10     1      > RETURN                                                   null

End of function methodone

Function methodtwo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tVQPi
function name:  methodTwo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'z'
   14     1      > RETURN                                                   null

End of function methodtwo

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.59 ms | 1396 KiB | 15 Q