3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dataset = array(0 => "one", 1 => "two"); reset($dataset); while ($v = current($dataset)) { var_dump($v); next($dataset); if ($a == "one") { unset($dataset[1]); } } var_dump($dataset); $dataset = array(0 => "one", 1 => "two"); reset($dataset); foreach ($dataset as $k => $v) { var_dump($a); next($dataset); if ($v == "one") { unset($dataset[1]); } } var_dump($dataset);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 5
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 39
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 39
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 38
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 38
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 5
Branch analysis from position: 19
Branch analysis from position: 5
Branch analysis from position: 14
filename:       /in/lPIU0
function name:  (null)
number of ops:  44
compiled vars:  !0 = $dataset, !1 = $v, !2 = $a, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        INIT_FCALL                                               'reset'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                                 
    5     4      > JMP                                                      ->14
    6     5    >   INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
    7     8        INIT_FCALL                                               'next'
          9        SEND_REF                                                 !0
         10        DO_ICALL                                                 
    8    11        IS_EQUAL                                                 !2, 'one'
         12      > JMPZ                                                     ~8, ->14
    9    13    >   UNSET_DIM                                                !0, 1
    5    14    >   INIT_FCALL                                               'current'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $9      
         17        ASSIGN                                           ~10     !1, $9
         18      > JMPNZ                                                    ~10, ->5
   13    19    >   INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                                 
   15    22        ASSIGN                                                   !0, <array>
   16    23        INIT_FCALL                                               'reset'
         24        SEND_REF                                                 !0
         25        DO_ICALL                                                 
   18    26      > FE_RESET_R                                       $14     !0, ->39
         27    > > FE_FETCH_R                                       ~15     $14, !1, ->39
         28    >   ASSIGN                                                   !3, ~15
   19    29        INIT_FCALL                                               'var_dump'
         30        SEND_VAR                                                 !2
         31        DO_ICALL                                                 
   20    32        INIT_FCALL                                               'next'
         33        SEND_REF                                                 !0
         34        DO_ICALL                                                 
   21    35        IS_EQUAL                                                 !1, 'one'
         36      > JMPZ                                                     ~19, ->38
   22    37    >   UNSET_DIM                                                !0, 1
   18    38    > > JMP                                                      ->27
         39    >   FE_FREE                                                  $14
   26    40        INIT_FCALL                                               'var_dump'
         41        SEND_VAR                                                 !0
         42        DO_ICALL                                                 
         43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.2 ms | 1400 KiB | 21 Q