3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '20\' Container 1, 40\' Open Container 1, 40-45\' Closed Container 3, container roll 10, container lift 50'; preg_match_all('/(\d*\'*)\s([a-zA-Z ]+)(\d+)/', $str, $matches); unset($matches[0]); $res =[]; foreach($matches[1] as $key => $val){ $res[] = array_column($matches, $key); } var_dump($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/4rGod
function name:  (null)
number of ops:  24
compiled vars:  !0 = $str, !1 = $matches, !2 = $res, !3 = $val, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '20%27+Container+1%2C+40%27+Open+Container+1%2C+40-45%27+Closed+Container+3%2C+container+roll+10%2C+container+lift+50'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%28%5Cd%2A%27%2A%29%5Cs%28%5Ba-zA-Z+%5D%2B%29%28%5Cd%2B%29%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    5     6        UNSET_DIM                                                !1, 0
    7     7        ASSIGN                                                   !2, <array>
    8     8        FETCH_DIM_R                                      ~8      !1, 1
          9      > FE_RESET_R                                       $9      ~8, ->19
         10    > > FE_FETCH_R                                       ~10     $9, !3, ->19
         11    >   ASSIGN                                                   !4, ~10
    9    12        INIT_FCALL                                               'array_column'
         13        SEND_VAR                                                 !1
         14        SEND_VAR                                                 !4
         15        DO_ICALL                                         $13     
         16        ASSIGN_DIM                                               !2
         17        OP_DATA                                                  $13
    8    18      > JMP                                                      ->10
         19    >   FE_FREE                                                  $9
   11    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.94 ms | 1012 KiB | 16 Q