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(MyClass::$staticMethodName()); var_dump($className::staticMethod());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/03Is6
function name:  (null)
number of ops:  20
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        INIT_STATIC_METHOD_CALL                                  'MyClass', !1
         10        DO_FCALL                                      0  $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                                 
   13    13        INIT_FCALL                                               'var_dump'
         14        FETCH_CLASS                                   0  $9      !0
         15        INIT_STATIC_METHOD_CALL                                  $9, 'staticMethod'
         16        DO_FCALL                                      0  $10     
         17        SEND_VAR                                                 $10
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

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