3v4l.org

run code in 300+ PHP versions simultaneously
<?php $measurements = "Hauteur/-/175 cm/-/Height/-/5'9''/-/00010/--/Buste (Femme)/-/92 cm/-/Bust (Women)/-/36''/-/00020/--/Taille/-/74 cm/-/Waist/-/29''/-/00022/--/Hanches/-/99 cm/-/Hips/-/39''/-/00023"; $regex = "%(.*?)/-/(.*?)/-/(.*?)/-/(.*?)/-/\d{5}(?:/--/){0,1}%"; preg_match_all($regex, $measurements, $matches); var_dump($matches); $output = []; for ($i = 0; $i<count($matches[0]);$i++) { $output[$matches[1][$i]]=$matches[2][$i]; $output[$matches[3][$i]]=$matches[4][$i]; } var_dump($output);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 13
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 13
Branch analysis from position: 30
Branch analysis from position: 13
filename:       /in/i4mQM
function name:  (null)
number of ops:  34
compiled vars:  !0 = $measurements, !1 = $regex, !2 = $matches, !3 = $output, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Hauteur%2F-%2F175+cm%2F-%2FHeight%2F-%2F5%279%27%27%2F-%2F00010%2F--%2FBuste+%28Femme%29%2F-%2F92+cm%2F-%2FBust+%28Women%29%2F-%2F36%27%27%2F-%2F00020%2F--%2FTaille%2F-%2F74+cm%2F-%2FWaist%2F-%2F29%27%27%2F-%2F00022%2F--%2FHanches%2F-%2F99+cm%2F-%2FHips%2F-%2F39%27%27%2F-%2F00023'
    4     1        ASSIGN                                                   !1, '%25%28.%2A%3F%29%2F-%2F%28.%2A%3F%29%2F-%2F%28.%2A%3F%29%2F-%2F%28.%2A%3F%29%2F-%2F%5Cd%7B5%7D%28%3F%3A%2F--%2F%29%7B0%2C1%7D%25'
    5     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
    6     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
    7    10        ASSIGN                                                   !3, <array>
    8    11        ASSIGN                                                   !4, 0
         12      > JMP                                                      ->26
    9    13    >   FETCH_DIM_R                                      ~11     !2, 1
         14        FETCH_DIM_R                                      ~12     ~11, !4
         15        FETCH_DIM_R                                      ~14     !2, 2
         16        FETCH_DIM_R                                      ~15     ~14, !4
         17        ASSIGN_DIM                                               !3, ~12
         18        OP_DATA                                                  ~15
   10    19        FETCH_DIM_R                                      ~16     !2, 3
         20        FETCH_DIM_R                                      ~17     ~16, !4
         21        FETCH_DIM_R                                      ~19     !2, 4
         22        FETCH_DIM_R                                      ~20     ~19, !4
         23        ASSIGN_DIM                                               !3, ~17
         24        OP_DATA                                                  ~20
    8    25        PRE_INC                                                  !4
         26    >   FETCH_DIM_R                                      ~22     !2, 0
         27        COUNT                                            ~23     ~22
         28        IS_SMALLER                                               !4, ~23
         29      > JMPNZ                                                    ~24, ->13
   12    30    >   INIT_FCALL                                               'var_dump'
         31        SEND_VAR                                                 !3
         32        DO_ICALL                                                 
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.59 ms | 1012 KiB | 15 Q