3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Enum { private static $cache = []; public static function __callStatic($name, $params) { $className = get_called_class(); if(!isset(self::$cache[$name])) { self::$cache[$name] = new $className($className::$$name); } return self::$cache[$name]; } } class Operator { public const A = 22; private const EQUALS = ['=']; private $symbol; private function __const(string $symbol) { $this->symbol = $symbol; } } $a = "A"; var_dump(Operator::$a); var_dump(Enum::EQUALS());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2LVU4
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   ASSIGN                                                   !0, 'A'
   26     1        INIT_FCALL                                               'var_dump'
          2        FETCH_STATIC_PROP_R          global lock         ~2      'a'
          3        SEND_VAL                                                 ~2
          4        DO_ICALL                                                 
   27     5        INIT_FCALL                                               'var_dump'
          6        INIT_STATIC_METHOD_CALL                                  'Enum', 'EQUALS'
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class Enum:
Function __callstatic:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/2LVU4
function name:  __callStatic
number of ops:  22
compiled vars:  !0 = $name, !1 = $params, !2 = $className
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        GET_CALLED_CLASS                                 ~3      
          3        ASSIGN                                                   !2, ~3
    9     4        FETCH_STATIC_PROP_IS                             ~5      'cache'
          5        ISSET_ISEMPTY_DIM_OBJ                         0  ~6      ~5, !0
          6        BOOL_NOT                                         ~7      ~6
          7      > JMPZ                                                     ~7, ->18
   10     8    >   FETCH_CLASS                                   0  $10     !2
          9        NEW                                              $11     $10
         10        CHECK_FUNC_ARG                                           
         11        FETCH_CLASS                                   0  $12     !2
         12        FETCH_STATIC_PROP_FUNC_ARG   unknown             $13     !0
         13        SEND_FUNC_ARG                                            $13
         14        DO_FCALL                                      0          
         15        FETCH_STATIC_PROP_W          unknown             $8      'cache'
         16        ASSIGN_DIM                                               $8, !0
         17        OP_DATA                                                  $11
   12    18    >   FETCH_STATIC_PROP_R          unknown             ~15     'cache'
         19        FETCH_DIM_R                                      ~16     ~15, !0
         20      > RETURN                                                   ~16
   13    21*     > RETURN                                                   null

End of function __callstatic

End of class Enum.

Class Operator:
Function __const:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2LVU4
function name:  __const
number of ops:  4
compiled vars:  !0 = $symbol
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   22     1        ASSIGN_OBJ                                               'symbol'
          2        OP_DATA                                                  !0
   23     3      > RETURN                                                   null

End of function __const

End of class Operator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.65 ms | 1400 KiB | 15 Q