3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bar(&$b) { switch ($b) { case 'bar': $b = null; } } $a = ['foo' => 'bar']; bar($a['foo']); var_dump(null === $a['foo']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5dWuf
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'bar'
          2        FETCH_DIM_W                                      $2      !0, 'foo'
          3        SEND_REF                                                 $2
          4        DO_FCALL                                      0          
   15     5        INIT_FCALL                                               'var_dump'
          6        FETCH_DIM_R                                      ~4      !0, 'foo'
          7        TYPE_CHECK                                    2  ~5      ~4
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function bar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5dWuf
function name:  bar
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    6     1        IS_EQUAL                                                 !0, 'bar'
          2      > JMPNZ                                                    ~1, ->4
          3    > > JMP                                                      ->5
    7     4    >   ASSIGN                                                   !0, null
    9     5    > > RETURN                                                   null

End of function bar

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.56 ms | 942 KiB | 17 Q