3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array['dump'] = 'dump'; $array['ids'] = array( 2 => array( 'id' => 1, 'val' => 'one'), 'delete' => 3, 1 => array( 'id' => 2, 'val' => 'two'), 0 => array( 'id' => 3, 'val' => 'three')); unset($array['ids']['delete']); foreach( $array['ids'] as $index => &$ids ) { if( $index == 2 ) { $ids['new'] = $ids['val']; } 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 = 19
Branch analysis from position: 8
2 jumps found. (Code = 126) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/nt22A
function name:  (null)
number of ops:  33
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, ->19
          8    > > FE_FETCH_RW                                      ~8      $7, !1, ->19
          9    >   ASSIGN                                                   !2, ~8
    9    10        IS_EQUAL                                                 !2, 2
         11      > JMPZ                                                     ~10, ->16
   10    12    >   FETCH_DIM_R                                      ~12     !1, 'val'
         13        ASSIGN_DIM                                               !1, 'new'
         14        OP_DATA                                                  ~12
         15      > JMP                                                      ->18
   12    16    >   ASSIGN_DIM                                               !1, 'new'
         17        OP_DATA                                                  ''
    8    18    > > JMP                                                      ->8
         19    >   FE_FREE                                                  $7
   16    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                                 
   18    23        INIT_FCALL                                               'array_values'
         24        FETCH_DIM_R                                      ~16     !0, 'ids'
         25        SEND_VAL                                                 ~16
         26        DO_ICALL                                         $17     
         27        ASSIGN_DIM                                               !0, 'ids'
         28        OP_DATA                                                  $17
   20    29        INIT_FCALL                                               'print_r'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
200.04 ms | 1396 KiB | 17 Q