3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = ['key1','value1','key2','value2']; //$output=['key1'=>'value1','key2'=>'value2']; $output=[]; do { $output[current($input)] = next($input); } while (next($input)); print_r($output);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
filename:       /in/8h36m
function name:  (null)
number of ops:  18
compiled vars:  !0 = $input, !1 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    7     2    >   INIT_FCALL                                               'current'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        INIT_FCALL                                               'next'
          6        SEND_REF                                                 !0
          7        DO_ICALL                                         $6      
          8        ASSIGN_DIM                                               !1, $4
          9        OP_DATA                                                  $6
    8    10        INIT_FCALL                                               'next'
         11        SEND_REF                                                 !0
         12        DO_ICALL                                         $7      
         13      > JMPNZ                                                    $7, ->2
    9    14    >   INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.24 ms | 1011 KiB | 16 Q