3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "1-350,9-390.99"; $partial = explode(',', $string); $final = array(); array_walk($partial, function($val,$key) use(&$final){ list($key, $value) = explode('-', $val); $final[$key] = $value; }); print_r($final);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/REpIv
function name:  (null)
number of ops:  17
compiled vars:  !0 = $string, !1 = $partial, !2 = $final
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '1-350%2C9-390.99'
    3     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    4     6        ASSIGN                                                   !2, <array>
    5     7        INIT_FCALL                                               'array_walk'
          8        SEND_REF                                                 !1
          9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FREpIv%3A5%240'
         10        BIND_LEXICAL                                             ~7, !2
    8    11        SEND_VAL                                                 ~7
         12        DO_ICALL                                                 
    9    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FREpIv%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/REpIv
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $val, !1 = $key, !2 = $final, !3 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
    6     3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '-'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        FETCH_LIST_R                                     $5      $4, 0
          8        ASSIGN                                                   !1, $5
          9        FETCH_LIST_R                                     $7      $4, 1
         10        ASSIGN                                                   !3, $7
         11        FREE                                                     $4
    7    12        ASSIGN_DIM                                               !2, !1
         13        OP_DATA                                                  !3
    8    14      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FREpIv%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.5 ms | 1396 KiB | 19 Q