3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array['dump'] = 'dump'; $array['ids'] = array( '0' => array( 'id' => 1, 'val' => 'one'), 'delete' => 3, '2' => array( 'id' => 2, 'val' => 'two'), '1' => array( 'id' => 3, 'val' => 'three')); unset($array['ids']['delete']); foreach( $array['ids'] as $index => &$ids ) { if( $index == 2 ) { $ids['new'] = 'new'; } else { $ids['new'] = ''; } } print_r($array); $array['ids'] = array_values($array['ids']); print_r($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
2 jumps found. (Code = 126) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/TtvKW
function name:  (null)
number of ops:  32
compiled vars:  !0 = $array, !1 = $ids, !2 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN_DIM                                               !0, 'dump'
          1        OP_DATA                                                  'dump'
    3     2        ASSIGN_DIM                                               !0, 'ids'
          3        OP_DATA                                                  <array>
    7     4        FETCH_DIM_UNSET                                  $5      !0, 'ids'
          5        UNSET_DIM                                                $5, 'delete'
    8     6        FETCH_DIM_W                                      $6      !0, 'ids'
          7      > FE_RESET_RW                                      $7      $6, ->18
          8    > > FE_FETCH_RW                                      ~8      $7, !1, ->18
          9    >   ASSIGN                                                   !2, ~8
    9    10        IS_EQUAL                                                 !2, 2
         11      > JMPZ                                                     ~10, ->15
   10    12    >   ASSIGN_DIM                                               !1, 'new'
         13        OP_DATA                                                  'new'
         14      > JMP                                                      ->17
   12    15    >   ASSIGN_DIM                                               !1, 'new'
         16        OP_DATA                                                  ''
    8    17    > > JMP                                                      ->8
         18    >   FE_FREE                                                  $7
   16    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                                 
   18    22        INIT_FCALL                                               'array_values'
         23        FETCH_DIM_R                                      ~15     !0, 'ids'
         24        SEND_VAL                                                 ~15
         25        DO_ICALL                                         $16     
         26        ASSIGN_DIM                                               !0, 'ids'
         27        OP_DATA                                                  $16
   20    28        INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.55 ms | 1396 KiB | 17 Q