3v4l.org

run code in 300+ PHP versions simultaneously
<?php $parameters = "userOnline=now, userName=- week"; $parametersString = explode(', ', $parameters); $parametersArray = array(); array_walk($parametersString, 'walk'); function walk(&$val, $key, $parametersArray){ $nums = explode('=', $val); $new_array[$nums[0]] = $nums[1]; } print_r($parametersArray);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C1miR
function name:  (null)
number of ops:  15
compiled vars:  !0 = $parameters, !1 = $parametersString, !2 = $parametersArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'userOnline%3Dnow%2C+userName%3D-+week'
    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        SEND_VAL                                                 'walk'
         10        DO_ICALL                                                 
   12    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function walk:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C1miR
function name:  walk
number of ops:  13
compiled vars:  !0 = $val, !1 = $key, !2 = $parametersArray, !3 = $nums, !4 = $new_array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    8     3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '%3D'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !3, $5
    9     8        FETCH_DIM_R                                      ~7      !3, 0
          9        FETCH_DIM_R                                      ~9      !3, 1
         10        ASSIGN_DIM                                               !4, ~7
         11        OP_DATA                                                  ~9
   10    12      > RETURN                                                   null

End of function walk

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.51 ms | 1396 KiB | 19 Q