3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "20' Container 1, 40' Open Container 1, 40-45' Closed Container 3, container roll 10, container lift 50"; preg_match_all( "~(\d+(?:-\d+)?')? (\D+) (\d+)~", $string, $matches, PREG_SET_ORDER ); print_r($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e7teLk
function name:  (null)
number of ops:  11
compiled vars:  !0 = $string, !1 = $matches
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'
    5     1        INIT_FCALL                                               'preg_match_all'
    6     2        SEND_VAL                                                 '%7E%28%5Cd%2B%28%3F%3A-%5Cd%2B%29%3F%27%29%3F+%28%5CD%2B%29+%28%5Cd%2B%29%7E'
    7     3        SEND_VAR                                                 !0
    8     4        SEND_REF                                                 !1
    9     5        SEND_VAL                                                 2
    5     6        DO_ICALL                                                 
   12     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.26 ms | 1004 KiB | 15 Q