3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public static function staticMethod() { return 'MyClass::staticMethod called'; } } $class = 'MyClass'; $staticMethodName = 'staticMethod'; $obj = new $class; var_dump($obj->$staticMethodName());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SjSvU
function name:  (null)
number of ops:  12
compiled vars:  !0 = $class, !1 = $staticMethodName, !2 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'MyClass'
    9     1        ASSIGN                                                   !1, 'staticMethod'
   11     2        FETCH_CLASS                                   0  $5      !0
          3        NEW                                              $6      $5
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $6
   13     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !2, !1
          8        DO_FCALL                                      0  $9      
          9        SEND_VAR                                                 $9
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class MyClass:
Function staticmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SjSvU
function name:  staticMethod
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   'MyClass%3A%3AstaticMethod+called'
    5     1*     > RETURN                                                   null

End of function staticmethod

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.04 ms | 1395 KiB | 15 Q