3v4l.org

run code in 300+ PHP versions simultaneously
<?php $photoList = array( array( 'id' => 1, 'name' => 'chelsea.jpg' ), array( 'id' => 2, 'name' => 'mu.jpg' ), array( 'id' => 3, 'name' => 'city.jpg' ) ); if(count($photoList) > 1) { $id = 1; $delete = false; foreach($photoList as $key => &$value) { if($value['id'] == $id && $delete == false){ $delete = true; unset($photoList[$key]); }Else if($delete == true){ $value["id"] = $id; $id++; } } } $photoList= array_values($photoList); Var_dump($photoList);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 25
Branch analysis from position: 4
2 jumps found. (Code = 125) Position 1 = 7, Position 2 = 24
Branch analysis from position: 7
2 jumps found. (Code = 126) Position 1 = 8, Position 2 = 24
Branch analysis from position: 8
2 jumps found. (Code = 46) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 23
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 23
Branch analysis from position: 14
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
Branch analysis from position: 25
filename:       /in/N2qjm
function name:  (null)
number of ops:  33
compiled vars:  !0 = $photoList, !1 = $id, !2 = $delete, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   16     1        COUNT                                            ~6      !0
          2        IS_SMALLER                                               1, ~6
          3      > JMPZ                                                     ~7, ->25
   17     4    >   ASSIGN                                                   !1, 1
   18     5        ASSIGN                                                   !2, <false>
   19     6      > FE_RESET_RW                                      $10     !0, ->24
          7    > > FE_FETCH_RW                                      ~11     $10, !3, ->24
          8    >   ASSIGN                                                   !4, ~11
   20     9        FETCH_DIM_R                                      ~13     !3, 'id'
         10        IS_EQUAL                                         ~14     !1, ~13
         11      > JMPZ_EX                                          ~14     ~14, ->14
         12    >   BOOL_NOT                                         ~15     !2
         13        BOOL                                             ~14     ~15
         14    > > JMPZ                                                     ~14, ->18
   21    15    >   ASSIGN                                                   !2, <true>
   22    16        UNSET_DIM                                                !0, !4
   20    17      > JMP                                                      ->23
   23    18    >   BOOL                                             ~17     !2
         19      > JMPZ                                                     ~17, ->23
   24    20    >   ASSIGN_DIM                                               !3, 'id'
         21        OP_DATA                                                  !1
   25    22        PRE_INC                                                  !1
   19    23    > > JMP                                                      ->7
         24    >   FE_FREE                                                  $10
   29    25    >   INIT_FCALL                                               'array_values'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $20     
         28        ASSIGN                                                   !0, $20
   30    29        INIT_FCALL                                               'var_dump'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.33 ms | 1008 KiB | 15 Q