3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$contents = file_get_contents($path); $contents = "sku-vendeur quantit prix id-produit 10000 3 51,95 B00E3LV204 10002 3 85,96 B00PE9ZC1E 100024 3 345,73 B01LWMZ33O 100031 3 88,22 B018NOSAZ6"; preg_match_all("/^(.*?)\s+(.*?)\s+(.*?)\s+(.*?)$/m", $contents, $arr); unset($arr[0]); // remove 0 since we don't need it. $keys = array_column($arr, 0); foreach($arr[1] as $key2 => $val){ if($key2 != 0){ $new[] = array_combine($keys,array_column($arr, $key2)); } } var_dump($new);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 29
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 29
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 28
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 28
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/YgeRa
function name:  (null)
number of ops:  34
compiled vars:  !0 = $contents, !1 = $arr, !2 = $keys, !3 = $val, !4 = $key2, !5 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'sku-vendeur+quantit+++prix++++id-produit%0A++++10000+++3+++51%2C95+++B00E3LV204%0A++++10002+++3+++85%2C96+++B00PE9ZC1E%0A++++100024++3+++345%2C73++B01LWMZ33O%0A++++100031++3+++88%2C22+++B018NOSAZ6'
   11     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%5E%28.%2A%3F%29%5Cs%2B%28.%2A%3F%29%5Cs%2B%28.%2A%3F%29%5Cs%2B%28.%2A%3F%29%24%2Fm'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
   13     6        UNSET_DIM                                                !1, 0
   14     7        INIT_FCALL                                               'array_column'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 0
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !2, $8
   16    12        FETCH_DIM_R                                      ~10     !1, 1
         13      > FE_RESET_R                                       $11     ~10, ->29
         14    > > FE_FETCH_R                                       ~12     $11, !3, ->29
         15    >   ASSIGN                                                   !4, ~12
   17    16        IS_NOT_EQUAL                                             !4, 0
         17      > JMPZ                                                     ~14, ->28
   18    18    >   INIT_FCALL                                               'array_combine'
         19        SEND_VAR                                                 !2
         20        INIT_FCALL                                               'array_column'
         21        SEND_VAR                                                 !1
         22        SEND_VAR                                                 !4
         23        DO_ICALL                                         $16     
         24        SEND_VAR                                                 $16
         25        DO_ICALL                                         $17     
         26        ASSIGN_DIM                                               !5
         27        OP_DATA                                                  $17
   16    28    > > JMP                                                      ->14
         29    >   FE_FREE                                                  $11
   22    30        INIT_FCALL                                               'var_dump'
         31        SEND_VAR                                                 !5
         32        DO_ICALL                                                 
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.21 ms | 957 KiB | 17 Q