3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( "action: Added; amount: 1; code: RNA1; name: Mens Organic T-shirt; colour: White; size: XL", "action: Subtracted; amount: 7; code: RNC1; name: Kids Basic T-shirt; colour: Denim Blue; size: 3-4y", "action: Added; amount: 20; code: RNV1; name: Gift Voucher; style: Mens; value: £20", ); $result = array_map(function($line) { return array_combine(...array_map(null, ...array_chunk(preg_split('/[:;]\s+/', $line), 2))); }, $arr); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xq8lS
function name:  (null)
number of ops:  11
compiled vars:  !0 = $arr, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FXq8lS%3A9%240'
   11     3        SEND_VAL                                                 ~3
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
    9     6        ASSIGN                                                   !1, $4
   13     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FXq8lS%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xq8lS
function name:  {closure}
number of ops:  20
compiled vars:  !0 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'array_combine'
          2        INIT_FCALL                                               'array_map'
          3        SEND_VAL                                                 null
          4        INIT_FCALL                                               'array_chunk'
          5        INIT_FCALL                                               'preg_split'
          6        SEND_VAL                                                 '%2F%5B%3A%3B%5D%5Cs%2B%2F'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $1      
          9        SEND_VAR                                                 $1
         10        SEND_VAL                                                 2
         11        DO_ICALL                                         $2      
         12        SEND_UNPACK                                              $2
         13        CHECK_UNDEF_ARGS                                         
         14        DO_ICALL                                         $3      
         15        SEND_UNPACK                                              $3
         16        CHECK_UNDEF_ARGS                                         
         17        DO_ICALL                                         $4      
         18      > RETURN                                                   $4
   11    19*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FXq8lS%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
132.25 ms | 1401 KiB | 23 Q