3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( 0 => 0, 1 => 1, 2 => 8, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 10 => 0, 11 => 0, 12 => 0, 14 => 0, 15 => 0, ); $keys = array_keys($array); $oldK = 0; while(current($keys) !== false){ $key = current($keys); if($key === $oldK) next($keys); else $array[$oldK] = 999; $oldK++; } ksort($array); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 7
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 17
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 7
Branch analysis from position: 25
Branch analysis from position: 7
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 7
Branch analysis from position: 25
Branch analysis from position: 7
filename:       /in/GD61j
function name:  (null)
number of ops:  32
compiled vars:  !0 = $array, !1 = $keys, !2 = $oldK, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   22     1        INIT_FCALL                                               'array_keys'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
   23     5        ASSIGN                                                   !2, 0
   24     6      > JMP                                                      ->20
   25     7    >   INIT_FCALL                                               'current'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !3, $8
   26    11        IS_IDENTICAL                                             !3, !2
         12      > JMPZ                                                     ~10, ->17
         13    >   INIT_FCALL                                               'next'
         14        SEND_REF                                                 !1
         15        DO_ICALL                                                 
         16      > JMP                                                      ->19
   27    17    >   ASSIGN_DIM                                               !0, !2
         18        OP_DATA                                                  999
   28    19    >   PRE_INC                                                  !2
   24    20    >   INIT_FCALL                                               'current'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $14     
         23        TYPE_CHECK                                  1018          $14
         24      > JMPNZ                                                    ~15, ->7
   31    25    >   INIT_FCALL                                               'ksort'
         26        SEND_REF                                                 !0
         27        DO_ICALL                                                 
   32    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:
276.98 ms | 1016 KiB | 18 Q