3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "20x9999,24x65,40x5"; $array1 = array(); $array2 = array(); foreach (explode(',', $str) as $key => $xy) { list($array1[$key], $array2[$key]) = explode('x', $xy); } print_r($array1); print_r($array2); $array1 = array(); $array2 = array(); foreach (explode(',', $str) as $key => $xy) { [$array1[$key], $array2[$key]] = explode('x', $xy); } print_r($array1); print_r($array2); preg_match_all('/(\d+)x(\d+)/', $str, $matches); $array1 = $matches[1]; $array2 = $matches[2]; print_r($array1); print_r($array2); preg_match_all('/(\d+)x(\d+)/', $str, $matches); [, $array1, $array2] = $matches; print_r($array1); print_r($array2);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 22
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 22
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 22
2 jumps found. (Code = 77) Position 1 = 36, Position 2 = 50
Branch analysis from position: 36
2 jumps found. (Code = 78) Position 1 = 37, Position 2 = 50
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
Branch analysis from position: 22
filename:       /in/LGok4
function name:  (null)
number of ops:  90
compiled vars:  !0 = $str, !1 = $array1, !2 = $array2, !3 = $xy, !4 = $key, !5 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '20x9999%2C24x65%2C40x5'
    5     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, <array>
    7     3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '%2C'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $9      
          7      > FE_RESET_R                                       $10     $9, ->22
          8    > > FE_FETCH_R                                       ~11     $10, !3, ->22
          9    >   ASSIGN                                                   !4, ~11
    8    10        INIT_FCALL                                               'explode'
         11        SEND_VAL                                                 'x'
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $13     
         14        FETCH_LIST_R                                     $14     $13, 0
         15        ASSIGN_DIM                                               !1, !4
         16        OP_DATA                                                  $14
         17        FETCH_LIST_R                                     $16     $13, 1
         18        ASSIGN_DIM                                               !2, !4
         19        OP_DATA                                                  $16
         20        FREE                                                     $13
    7    21      > JMP                                                      ->8
         22    >   FE_FREE                                                  $10
   10    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                                 
   11    26        INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !2
         28        DO_ICALL                                                 
   13    29        ASSIGN                                                   !1, <array>
   14    30        ASSIGN                                                   !2, <array>
   15    31        INIT_FCALL                                               'explode'
         32        SEND_VAL                                                 '%2C'
         33        SEND_VAR                                                 !0
         34        DO_ICALL                                         $22     
         35      > FE_RESET_R                                       $23     $22, ->50
         36    > > FE_FETCH_R                                       ~24     $23, !3, ->50
         37    >   ASSIGN                                                   !4, ~24
   16    38        INIT_FCALL                                               'explode'
         39        SEND_VAL                                                 'x'
         40        SEND_VAR                                                 !3
         41        DO_ICALL                                         $26     
         42        FETCH_LIST_R                                     $27     $26, 0
         43        ASSIGN_DIM                                               !1, !4
         44        OP_DATA                                                  $27
         45        FETCH_LIST_R                                     $29     $26, 1
         46        ASSIGN_DIM                                               !2, !4
         47        OP_DATA                                                  $29
         48        FREE                                                     $26
   15    49      > JMP                                                      ->36
         50    >   FE_FREE                                                  $23
   18    51        INIT_FCALL                                               'print_r'
         52        SEND_VAR                                                 !1
         53        DO_ICALL                                                 
   19    54        INIT_FCALL                                               'print_r'
         55        SEND_VAR                                                 !2
         56        DO_ICALL                                                 
   21    57        INIT_FCALL                                               'preg_match_all'
         58        SEND_VAL                                                 '%2F%28%5Cd%2B%29x%28%5Cd%2B%29%2F'
         59        SEND_VAR                                                 !0
         60        SEND_REF                                                 !5
         61        DO_ICALL                                                 
   22    62        FETCH_DIM_R                                      ~34     !5, 1
         63        ASSIGN                                                   !1, ~34
   23    64        FETCH_DIM_R                                      ~36     !5, 2
         65        ASSIGN                                                   !2, ~36
   24    66        INIT_FCALL                                               'print_r'
         67        SEND_VAR                                                 !1
         68        DO_ICALL                                                 
   25    69        INIT_FCALL                                               'print_r'
         70        SEND_VAR                                                 !2
         71        DO_ICALL                                                 
   27    72        INIT_FCALL                                               'preg_match_all'
         73        SEND_VAL                                                 '%2F%28%5Cd%2B%29x%28%5Cd%2B%29%2F'
         74        SEND_VAR                                                 !0
         75        SEND_REF                                                 !5
         76        DO_ICALL                                                 
   28    77        QM_ASSIGN                                        ~41     !5
         78        FETCH_LIST_R                                     $42     ~41, 1
         79        ASSIGN                                                   !1, $42
         80        FETCH_LIST_R                                     $44     ~41, 2
         81        ASSIGN                                                   !2, $44
         82        FREE                                                     ~41
   29    83        INIT_FCALL                                               'print_r'
         84        SEND_VAR                                                 !1
         85        DO_ICALL                                                 
   30    86        INIT_FCALL                                               'print_r'
         87        SEND_VAR                                                 !2
         88        DO_ICALL                                                 
         89      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.15 ms | 1078 KiB | 16 Q