3v4l.org

run code in 500+ PHP versions simultaneously
<?php $a1 = ['a' => 0, 'c' => 1, 'e' => 2]; $a2 = ['b' => 3, 'd' => 4, 'f' => 5]; $result = []; while($a1 && $a2) { $result += array_splice($a1, 0, 1) + array_splice($a2, 0, 1); } var_export($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 4
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
Branch analysis from position: 18
Branch analysis from position: 18
filename:       /in/401Ue
function name:  (null)
number of ops:  23
compiled vars:  !0 = $a1, !1 = $a2, !2 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, <array>
    6     2        ASSIGN                                                       !2, <array>
    7     3      > JMP                                                          ->16
    8     4    >   INIT_FCALL                                                   'array_splice'
          5        SEND_REF                                                     !0
          6        SEND_VAL                                                     0
          7        SEND_VAL                                                     1
          8        DO_ICALL                                             $6      
    9     9        INIT_FCALL                                                   'array_splice'
         10        SEND_REF                                                     !1
         11        SEND_VAL                                                     0
         12        SEND_VAL                                                     1
         13        DO_ICALL                                             $7      
         14        ADD                                                  ~8      $6, $7
         15        ASSIGN_OP                                         1          !2, ~8
    7    16    > > JMPZ_EX                                              ~10     !0, ->18
         17    >   BOOL                                                 ~10     !1
         18    > > JMPNZ                                                        ~10, ->4
   12    19    >   INIT_FCALL                                                   'var_export'
         20        SEND_VAR                                                     !2
         21        DO_ICALL                                                     
         22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.04 ms | 1905 KiB | 15 Q