3v4l.org

run code in 300+ PHP versions simultaneously
<?php $long_string = '"name" => "Able","company" => "Tesla","haircolor" => "brown","name" => "Aaaa","home" => "Kansas","shoe" => 12<>"name" => "Bob","company" => "Target","haircolor" => "red","name" => "Bbbb","home" =>"Ohio","shoe" => 11.5'; function multiexplode ($delimiters,$string) { $ary = explode($delimiters[0],$string); array_shift($delimiters); if($delimiters != NULL) { foreach($ary as $key => $val) { $ary[$key] = multiexplode($delimiters, $val); } } return $ary; } // Example of use // $string = "1-2-3|4-5|6:7-8-9-0|1,2:3-4|5"; // $delimiters = Array(",",":","|","-"); $delimiters = Array("<>",","); $res = multiexplode($delimiters,$long_string); echo '<pre>'; print_r($res); echo '</pre>';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5rDAO
function name:  (null)
number of ops:  13
compiled vars:  !0 = $long_string, !1 = $delimiters, !2 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '%22name%22+%3D%3E+%22Able%22%2C%22company%22+%3D%3E+%22Tesla%22%2C%22haircolor%22+%3D%3E+%22brown%22%2C%22name%22+%3D%3E+%22Aaaa%22%2C%22home%22+%3D%3E+%22Kansas%22%2C%22shoe%22+%3D%3E+12%3C%3E%22name%22+%3D%3E+%22Bob%22%2C%22company%22+%3D%3E+%22Target%22%2C%22haircolor%22+%3D%3E+%22red%22%2C%22name%22+%3D%3E+%22Bbbb%22%2C%22home%22+%3D%3E%22Ohio%22%2C%22shoe%22+%3D%3E+11.5'
   21     1        ASSIGN                                                   !1, <array>
   23     2        INIT_FCALL                                               'multiexplode'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !2, $5
   24     7        ECHO                                                     '%3Cpre%3E'
   25     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
   26    11        ECHO                                                     '%3C%2Fpre%3E'
         12      > RETURN                                                   1

Function multiexplode:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 24
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 23
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 23
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
Branch analysis from position: 24
filename:       /in/5rDAO
function name:  multiexplode
number of ops:  26
compiled vars:  !0 = $delimiters, !1 = $string, !2 = $ary, !3 = $val, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        INIT_FCALL                                               'explode'
          3        FETCH_DIM_R                                      ~5      !0, 0
          4        SEND_VAL                                                 ~5
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !2, $6
    8     8        INIT_FCALL                                               'array_shift'
          9        SEND_REF                                                 !0
         10        DO_ICALL                                                 
    9    11        IS_NOT_EQUAL                                             !0, null
         12      > JMPZ                                                     ~9, ->24
   10    13    > > FE_RESET_R                                       $10     !2, ->23
         14    > > FE_FETCH_R                                       ~11     $10, !3, ->23
         15    >   ASSIGN                                                   !4, ~11
   11    16        INIT_FCALL_BY_NAME                                       'multiexplode'
         17        SEND_VAR_EX                                              !0
         18        SEND_VAR_EX                                              !3
         19        DO_FCALL                                      0  $14     
         20        ASSIGN_DIM                                               !2, !4
         21        OP_DATA                                                  $14
   10    22      > JMP                                                      ->14
         23    >   FE_FREE                                                  $10
   14    24    > > RETURN                                                   !2
   15    25*     > RETURN                                                   null

End of function multiexplode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.61 ms | 1403 KiB | 20 Q