3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '"20x9,999",24x65,40x5'; $one = []; $two = []; foreach (str_getcsv($str) as $set) { [$one[], $two[]] = explode('x', $set); } var_dump($one, $two);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 20
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 20
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/t8km6
function name:  (null)
number of ops:  26
compiled vars:  !0 = $str, !1 = $one, !2 = $two, !3 = $set
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2220x9%2C999%22%2C24x65%2C40x5'
    5     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, <array>
    7     3        INIT_FCALL                                               'str_getcsv'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $7      
          6      > FE_RESET_R                                       $8      $7, ->20
          7    > > FE_FETCH_R                                               $8, !3, ->20
    8     8    >   INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 'x'
         10        SEND_VAR                                                 !3
         11        DO_ICALL                                         $9      
         12        FETCH_LIST_R                                     $10     $9, 0
         13        ASSIGN_DIM                                               !1
         14        OP_DATA                                                  $10
         15        FETCH_LIST_R                                     $12     $9, 1
         16        ASSIGN_DIM                                               !2
         17        OP_DATA                                                  $12
         18        FREE                                                     $9
    7    19      > JMP                                                      ->7
         20    >   FE_FREE                                                  $8
   10    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !1
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.26 ms | 1012 KiB | 16 Q