3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = ['a' => '1','b' => 2]; $arr2 = ['h' => 'c','j' => '3']; $result = []; while ($arr1 && $arr2) { $result += array_splice($arr1, 0, 1) + array_splice($arr2, 0, 1); } $result += $arr1 + $arr2; 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/CCf0P
function name:  (null)
number of ops:  25
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    7     2        ASSIGN                                                   !2, <array>
    8     3      > JMP                                                      ->16
    9     4    >   INIT_FCALL                                               'array_splice'
          5        SEND_REF                                                 !0
          6        SEND_VAL                                                 0
          7        SEND_VAL                                                 1
          8        DO_ICALL                                         $6      
   10     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
    8    16    > > JMPZ_EX                                          ~10     !0, ->18
         17    >   BOOL                                             ~10     !1
         18    > > JMPNZ                                                    ~10, ->4
   12    19    >   ADD                                              ~11     !0, !1
         20        ASSIGN_OP                                     1          !2, ~11
   13    21        INIT_FCALL                                               'var_export'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.21 ms | 1003 KiB | 15 Q