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'; var_dump(x::$constant); var_dump(x::$constant); var_dump($class::$constant); var_dump($class::$function()); $classConstant = $class . '::' . $constant; $classFunc1 = $class . '::' . $function; $classFunc2 = array($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/mqCsl
function name:  (null)
number of ops:  45
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'
   14     3        INIT_FCALL                                               'var_dump'
          4        FETCH_STATIC_PROP_R          global lock         ~9      'constant'
          5        SEND_VAL                                                 ~9
          6        DO_ICALL                                                 
   15     7        INIT_FCALL                                               'var_dump'
          8        FETCH_STATIC_PROP_R          unknown             ~11     'constant'
          9        SEND_VAL                                                 ~11
         10        DO_ICALL                                                 
   17    11        INIT_FCALL                                               'var_dump'
         12        FETCH_CLASS                                   0  $13     !0
         13        FETCH_STATIC_PROP_R          unknown             ~14     'constant'
         14        SEND_VAL                                                 ~14
         15        DO_ICALL                                                 
   18    16        INIT_FCALL                                               'var_dump'
         17        FETCH_CLASS                                   0  $16     !0
         18        INIT_STATIC_METHOD_CALL                                  $16, !2
         19        DO_FCALL                                      0  $17     
         20        SEND_VAR                                                 $17
         21        DO_ICALL                                                 
   20    22        CONCAT                                           ~19     !0, '%3A%3A'
         23        CONCAT                                           ~20     ~19, !1
         24        ASSIGN                                                   !3, ~20
   21    25        CONCAT                                           ~22     !0, '%3A%3A'
         26        CONCAT                                           ~23     ~22, !2
         27        ASSIGN                                                   !4, ~23
   22    28        INIT_ARRAY                                       ~25     !0
         29        ADD_ARRAY_ELEMENT                                ~25     !2
         30        ASSIGN                                                   !5, ~25
   23    31        INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !3
         33        DO_ICALL                                                 
   24    34        INIT_FCALL                                               'var_dump'
         35        INIT_DYNAMIC_CALL                                        !4
         36        DO_FCALL                                      0  $28     
         37        SEND_VAR                                                 $28
         38        DO_ICALL                                                 
   25    39        INIT_FCALL                                               'var_dump'
         40        INIT_DYNAMIC_CALL                                        !5
         41        DO_FCALL                                      0  $30     
         42        SEND_VAR                                                 $30
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Class x:
Function func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mqCsl
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:
157.04 ms | 1400 KiB | 15 Q