3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( '1st' => 'a', '2nd' => 'b', '3rd' => 'b' ); foreach($array as &$value) { if($value === 'a') { $array['1st'] = '1'; $array['2nd'] = '2'; array_splice($array, 0, 0, array('x')); //array pointer 초기화 //array_splice($array, count($array), 0, array('y')); //array pointer 초기화 } var_dump($value); } unset($value);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 19
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/5kYoK
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1      > FE_RESET_RW                                      $3      !0, ->19
          2    > > FE_FETCH_RW                                              $3, !1, ->19
   10     3    >   IS_IDENTICAL                                             !1, 'a'
          4      > JMPZ                                                     ~4, ->15
   12     5    >   ASSIGN_DIM                                               !0, '1st'
          6        OP_DATA                                                  '1'
   13     7        ASSIGN_DIM                                               !0, '2nd'
          8        OP_DATA                                                  '2'
   14     9        INIT_FCALL                                               'array_splice'
         10        SEND_REF                                                 !0
         11        SEND_VAL                                                 0
         12        SEND_VAL                                                 0
         13        SEND_VAL                                                 <array>
         14        DO_ICALL                                                 
   17    15    >   INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
    8    18      > JMP                                                      ->2
         19    >   FE_FREE                                                  $3
   19    20        UNSET_CV                                                 !1
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
128.05 ms | 1400 KiB | 17 Q