3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [0 => 0, 1=> 0, 4 => 0, 6 => 0]; $full = array_fill(0,6,999); foreach($full as $k => &$v) if (isset($arr[$k])) $v = $arr[$k]; print_r($full); $new = $arr + array_fill(0,6,999); ksort($new); print_r($new);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 126) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/pd8G1
function name:  (null)
number of ops:  33
compiled vars:  !0 = $arr, !1 = $full, !2 = $v, !3 = $k, !4 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        INIT_FCALL                                               'array_fill'
          2        SEND_VAL                                                 0
          3        SEND_VAL                                                 6
          4        SEND_VAL                                                 999
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !1, $6
    7     7      > FE_RESET_RW                                      $8      !1, ->15
          8    > > FE_FETCH_RW                                      ~9      $8, !2, ->15
          9    >   ASSIGN                                                   !3, ~9
    8    10        ISSET_ISEMPTY_DIM_OBJ                         0          !0, !3
         11      > JMPZ                                                     ~11, ->14
         12    >   FETCH_DIM_R                                      ~12     !0, !3
         13        ASSIGN                                                   !2, ~12
    7    14    > > JMP                                                      ->8
         15    >   FE_FREE                                                  $8
   11    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
   13    19        INIT_FCALL                                               'array_fill'
         20        SEND_VAL                                                 0
         21        SEND_VAL                                                 6
         22        SEND_VAL                                                 999
         23        DO_ICALL                                         $15     
         24        ADD                                              ~16     !0, $15
         25        ASSIGN                                                   !4, ~16
   14    26        INIT_FCALL                                               'ksort'
         27        SEND_REF                                                 !4
         28        DO_ICALL                                                 
   16    29        INIT_FCALL                                               'print_r'
         30        SEND_VAR                                                 !4
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.5 ms | 1013 KiB | 16 Q