3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ 'firstname' , 'bob' , 'lastname' , 'alex' ]; $new = array_combine( array_intersect_key($a, array_flip(range(0, count($a) - 1, 2))), array_intersect_key($a, array_flip(range(1, count($a) - 1, 2))) ); print_r($new);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5IkF0
function name:  (null)
number of ops:  38
compiled vars:  !0 = $a, !1 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'array_combine'
    6     2        INIT_FCALL                                               'array_intersect_key'
          3        SEND_VAR                                                 !0
          4        INIT_FCALL                                               'array_flip'
          5        INIT_FCALL                                               'range'
          6        SEND_VAL                                                 0
          7        COUNT                                            ~3      !0
          8        SUB                                              ~4      ~3, 1
          9        SEND_VAL                                                 ~4
         10        SEND_VAL                                                 2
         11        DO_ICALL                                         $5      
         12        SEND_VAR                                                 $5
         13        DO_ICALL                                         $6      
         14        SEND_VAR                                                 $6
         15        DO_ICALL                                         $7      
         16        SEND_VAR                                                 $7
    7    17        INIT_FCALL                                               'array_intersect_key'
         18        SEND_VAR                                                 !0
         19        INIT_FCALL                                               'array_flip'
         20        INIT_FCALL                                               'range'
         21        SEND_VAL                                                 1
         22        COUNT                                            ~8      !0
         23        SUB                                              ~9      ~8, 1
         24        SEND_VAL                                                 ~9
         25        SEND_VAL                                                 2
         26        DO_ICALL                                         $10     
         27        SEND_VAR                                                 $10
         28        DO_ICALL                                         $11     
         29        SEND_VAR                                                 $11
         30        DO_ICALL                                         $12     
         31        SEND_VAR                                                 $12
         32        DO_ICALL                                         $13     
    5    33        ASSIGN                                                   !1, $13
   10    34        INIT_FCALL                                               'print_r'
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.03 ms | 1401 KiB | 23 Q