3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { const CONSTANT = 'const'; public static function func() { return __METHOD__; } } $class = 'x'; $constant = 'CONSTANT'; $function = 'func'; $classConstant = $class . '::' . $constant; $classFunc1 = $class . '::' . $function; $classFunc2 = array($class, $function); var_dump(x::CONSTANT); var_dump(x::func()); var_dump($class::CONSTANT); var_dump($class::func()); var_dump($class::$function()); var_dump($classConstant); var_dump($classFunc1()); var_dump($classFunc2());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g9jR8
function name:  (null)
number of ops:  51
compiled vars:  !0 = $class, !1 = $constant, !2 = $function, !3 = $classConstant, !4 = $classFunc1, !5 = $classFunc2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, 'x'
   11     1        ASSIGN                                                   !1, 'CONSTANT'
   12     2        ASSIGN                                                   !2, 'func'
   13     3        CONCAT                                           ~9      !0, '%3A%3A'
          4        CONCAT                                           ~10     ~9, !1
          5        ASSIGN                                                   !3, ~10
   14     6        CONCAT                                           ~12     !0, '%3A%3A'
          7        CONCAT                                           ~13     ~12, !2
          8        ASSIGN                                                   !4, ~13
   15     9        INIT_ARRAY                                       ~15     !0
         10        ADD_ARRAY_ELEMENT                                ~15     !2
         11        ASSIGN                                                   !5, ~15
   17    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAL                                                 'const'
         14        DO_ICALL                                                 
   18    15        INIT_FCALL                                               'var_dump'
         16        INIT_STATIC_METHOD_CALL                                  'x', 'func'
         17        DO_FCALL                                      0  $18     
         18        SEND_VAR                                                 $18
         19        DO_ICALL                                                 
   20    20        INIT_FCALL                                               'var_dump'
         21        FETCH_CLASS                                   0  $20     !0
         22        FETCH_CLASS_CONSTANT                             ~21     $20, 'CONSTANT'
         23        SEND_VAL                                                 ~21
         24        DO_ICALL                                                 
   21    25        INIT_FCALL                                               'var_dump'
         26        FETCH_CLASS                                   0  $23     !0
         27        INIT_STATIC_METHOD_CALL                                  $23, 'func'
         28        DO_FCALL                                      0  $24     
         29        SEND_VAR                                                 $24
         30        DO_ICALL                                                 
   22    31        INIT_FCALL                                               'var_dump'
         32        FETCH_CLASS                                   0  $26     !0
         33        INIT_STATIC_METHOD_CALL                                  $26, !2
         34        DO_FCALL                                      0  $27     
         35        SEND_VAR                                                 $27
         36        DO_ICALL                                                 
   24    37        INIT_FCALL                                               'var_dump'
         38        SEND_VAR                                                 !3
         39        DO_ICALL                                                 
   25    40        INIT_FCALL                                               'var_dump'
         41        INIT_DYNAMIC_CALL                                        !4
         42        DO_FCALL                                      0  $30     
         43        SEND_VAR                                                 $30
         44        DO_ICALL                                                 
   26    45        INIT_FCALL                                               'var_dump'
         46        INIT_DYNAMIC_CALL                                        !5
         47        DO_FCALL                                      0  $32     
         48        SEND_VAR                                                 $32
         49        DO_ICALL                                                 
         50      > RETURN                                                   1

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

End of function func

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.8 ms | 1400 KiB | 15 Q