3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 'a' => 'A', 'b' => 'B', 'c' => 'C'); var_dump($arr); // Taking "$val" as a reference here allows modifying the parent hashtable // directly, i.e. the $val ref "knows" its parent key in some sense foreach ($arr as &$val) { if ($val == 'B') { $val = 'X'; } } unset($arr[2]); var_dump($arr); // However, it doesn't allow you to unset the parent key... foreach ($arr as &$val) { if ($val == 'B') { } } var_dump($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
2 jumps found. (Code = 126) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 9
Branch analysis from position: 10
2 jumps found. (Code = 125) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
2 jumps found. (Code = 126) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 19
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 19
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 10
filename:       /in/YNvXQ
function name:  (null)
number of ops:  25
compiled vars:  !0 = $arr, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   12     4      > FE_RESET_RW                                      $4      !0, ->10
          5    > > FE_FETCH_RW                                              $4, !1, ->10
   13     6    >   IS_EQUAL                                                 !1, 'B'
          7      > JMPZ                                                     ~5, ->9
   14     8    >   ASSIGN                                                   !1, 'X'
   12     9    > > JMP                                                      ->5
         10    >   FE_FREE                                                  $4
   17    11        UNSET_DIM                                                !0, 2
   18    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
   21    15      > FE_RESET_RW                                      $8      !0, ->20
         16    > > FE_FETCH_RW                                              $8, !1, ->20
   22    17    >   IS_EQUAL                                                 !1, 'B'
         18      > JMPZ                                                     ~9, ->19
   21    19    > > JMP                                                      ->16
         20    >   FE_FREE                                                  $8
   27    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.82 ms | 1396 KiB | 15 Q