3v4l.org

run code in 500+ PHP versions simultaneously
<?php namespace Test; function enum() { for($enums = func_get_args(), $enum = reset($enums), $i = 1; $enum; $enum = next($enums), ++$i) { eval('const ' . $enum . ' = ' . $i . ';'); } } // enum() enum('CONST0', 'CONST1', 'CONST2'); print_r(CONST0);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1eg3U
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   INIT_NS_FCALL_BY_NAME                                        'Test%5Cenum'
          1        SEND_VAL_EX                                                  'CONST0'
          2        SEND_VAL_EX                                                  'CONST1'
          3        SEND_VAL_EX                                                  'CONST2'
          4        DO_FCALL                                          0          
   15     5        INIT_NS_FCALL_BY_NAME                                        'Test%5Cprint_r'
          6        FETCH_CONSTANT                                       ~1      'Test%5CCONST0'
          7        SEND_VAL_EX                                                  ~1
          8        DO_FCALL                                          0          
          9      > RETURN                                                       1

Function test%5Cenum:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 9
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 9
Branch analysis from position: 20
Branch analysis from position: 9
filename:       /in/1eg3U
function name:  Test\enum
number of ops:  21
compiled vars:  !0 = $enums, !1 = $enum, !2 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   INIT_NS_FCALL_BY_NAME                                        'Test%5Cfunc_get_args'
          1        DO_FCALL                                          0  $3      
          2        ASSIGN                                                       !0, $3
          3        INIT_NS_FCALL_BY_NAME                                        'Test%5Creset'
          4        SEND_VAR_EX                                                  !0
          5        DO_FCALL                                          0  $5      
          6        ASSIGN                                                       !1, $5
          7        ASSIGN                                                       !2, 1
          8      > JMP                                                          ->19
    8     9    >   CONCAT                                               ~8      'const+', !1
         10        CONCAT                                               ~9      ~8, '+%3D+'
         11        CONCAT                                               ~10     ~9, !2
         12        CONCAT                                               ~11     ~10, '%3B'
         13        INCLUDE_OR_EVAL                                              ~11, EVAL
    6    14        INIT_NS_FCALL_BY_NAME                                        'Test%5Cnext'
         15        SEND_VAR_EX                                                  !0
         16        DO_FCALL                                          0  $13     
         17        ASSIGN                                                       !1, $13
         18        PRE_INC                                                      !2
         19    > > JMPNZ                                                        !1, ->9
   11    20    > > RETURN                                                       null

End of function test%5Cenum

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
223.88 ms | 2823 KiB | 18 Q