3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = '1-350,9-390.99'; $chunks = array_chunk(preg_split('/(-|,)/', $input), 2); $result = array_combine(array_column($chunks, 0), array_column($chunks, 1)); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DTXAF
function name:  (null)
number of ops:  27
compiled vars:  !0 = $input, !1 = $chunks, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '1-350%2C9-390.99'
    5     1        INIT_FCALL                                               'array_chunk'
          2        INIT_FCALL                                               'preg_split'
          3        SEND_VAL                                                 '%2F%28-%7C%2C%29%2F'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        SEND_VAR                                                 $4
          7        SEND_VAL                                                 2
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !1, $5
    6    10        INIT_FCALL                                               'array_combine'
         11        INIT_FCALL                                               'array_column'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 0
         14        DO_ICALL                                         $7      
         15        SEND_VAR                                                 $7
         16        INIT_FCALL                                               'array_column'
         17        SEND_VAR                                                 !1
         18        SEND_VAL                                                 1
         19        DO_ICALL                                         $8      
         20        SEND_VAR                                                 $8
         21        DO_ICALL                                         $9      
         22        ASSIGN                                                   !2, $9
    8    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.99 ms | 1457 KiB | 18 Q