3v4l.org

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

Class MyClass:
Function staticmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tP02h
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:
135.9 ms | 1436 KiB | 14 Q