3v4l.org

run code in 500+ PHP versions simultaneously
<?php $keys = ['id', 'creditcard', 'annualfee', 'regularapr', 'purchaseapr', 'balancetransferapr']; $data = [ 'id', 'creditcard', 'annualfee', 'regularapr', 'purchaseapr', 'balancetransferapr', '1', 'Discover it Cash Back', '$10', '11.99% - 22.99% variable', '0% for 14 months Valin Link', '0% for 14 months', '2', 'Chase Freedom Unlimited', '$20', '22.99 - 22.74% Variable', '0% Intro APR on Purchases for 15 months', 'N/A', ]; $chunks = array_chunk($data, count($keys)); // throw away first chunk as it holds filed names array_shift($chunks); $result = []; foreach ($chunks as $chunk) { $result[] = array_combine($keys, $chunk); } print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 21
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/85dW0
function name:  (null)
number of ops:  26
compiled vars:  !0 = $keys, !1 = $data, !2 = $chunks, !3 = $result, !4 = $chunk
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, <array>
   10     2        INIT_FCALL                                                   'array_chunk'
          3        SEND_VAR                                                     !1
          4        COUNT                                                ~7      !0
          5        SEND_VAL                                                     ~7
          6        DO_ICALL                                             $8      
          7        ASSIGN                                                       !2, $8
   12     8        INIT_FCALL                                                   'array_shift'
          9        SEND_REF                                                     !2
         10        DO_ICALL                                                     
   14    11        ASSIGN                                                       !3, <array>
   15    12      > FE_RESET_R                                           $12     !2, ->21
         13    > > FE_FETCH_R                                                   $12, !4, ->21
   16    14    >   INIT_FCALL                                                   'array_combine'
         15        SEND_VAR                                                     !0
         16        SEND_VAR                                                     !4
         17        DO_ICALL                                             $14     
         18        ASSIGN_DIM                                                   !3
         19        OP_DATA                                                      $14
   15    20      > JMP                                                          ->13
         21    >   FE_FREE                                                      $12
   19    22        INIT_FCALL                                                   'print_r'
         23        SEND_VAR                                                     !3
         24        DO_ICALL                                                     
         25      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.39 ms | 2150 KiB | 17 Q