3v4l.org

run code in 300+ PHP versions simultaneously
<?php $null = null; $ret = 0; switch ("foo") { case $null['abc']: $ret = 1; break; case $null['def']: $ret = 2; break; case $null['ghi']: $ret = 3; break; } var_dump($null, $ret, $null['abc'], $null['def'], $null['ghi']);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
filename:       /in/C8mMJ
function name:  (null)
number of ops:  29
compiled vars:  !0 = $null, !1 = $ret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, null
    3     1        ASSIGN                                                   !1, 0
    7     2        FETCH_DIM_R                                      ~5      !0, 'abc'
          3        IS_EQUAL                                                 ~5, 'foo'
          4      > JMPNZ                                                    ~4, ->12
   11     5    >   FETCH_DIM_R                                      ~6      !0, 'def'
          6        IS_EQUAL                                                 ~6, 'foo'
          7      > JMPNZ                                                    ~4, ->14
   15     8    >   FETCH_DIM_R                                      ~7      !0, 'ghi'
          9        IS_EQUAL                                                 ~7, 'foo'
         10      > JMPNZ                                                    ~4, ->16
         11    > > JMP                                                      ->18
    8    12    >   ASSIGN                                                   !1, 1
    9    13      > JMP                                                      ->18
   12    14    >   ASSIGN                                                   !1, 2
   13    15      > JMP                                                      ->18
   16    16    >   ASSIGN                                                   !1, 3
   17    17      > JMP                                                      ->18
   20    18    >   INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !0
         20        SEND_VAR                                                 !1
         21        FETCH_DIM_R                                      ~11     !0, 'abc'
         22        SEND_VAL                                                 ~11
         23        FETCH_DIM_R                                      ~12     !0, 'def'
         24        SEND_VAL                                                 ~12
         25        FETCH_DIM_R                                      ~13     !0, 'ghi'
         26        SEND_VAL                                                 ~13
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.31 ms | 1396 KiB | 15 Q