3v4l.org

run code in 300+ PHP versions simultaneously
<?php $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 = 6, Position 2 = 16
Branch analysis from position: 6
2 jumps found. (Code = 126) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/Ps6nN
function name:  (null)
number of ops:  30
compiled vars:  !0 = $array, !1 = $ids, !2 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0, 'ids'
          1        OP_DATA                                                  <array>
    7     2        FETCH_DIM_UNSET                                  $4      !0, 'ids'
          3        UNSET_DIM                                                $4, 'delete'
    8     4        FETCH_DIM_W                                      $5      !0, 'ids'
          5      > FE_RESET_RW                                      $6      $5, ->16
          6    > > FE_FETCH_RW                                      ~7      $6, !1, ->16
          7    >   ASSIGN                                                   !2, ~7
    9     8        IS_EQUAL                                                 !2, 2
          9      > JMPZ                                                     ~9, ->13
   10    10    >   ASSIGN_DIM                                               !1, 'new'
         11        OP_DATA                                                  'new'
         12      > JMP                                                      ->15
   12    13    >   ASSIGN_DIM                                               !1, 'new'
         14        OP_DATA                                                  ''
    8    15    > > JMP                                                      ->6
         16    >   FE_FREE                                                  $6
   16    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
   18    20        INIT_FCALL                                               'array_values'
         21        FETCH_DIM_R                                      ~14     !0, 'ids'
         22        SEND_VAL                                                 ~14
         23        DO_ICALL                                         $15     
         24        ASSIGN_DIM                                               !0, 'ids'
         25        OP_DATA                                                  $15
   20    26        INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.8 ms | 1396 KiB | 17 Q