3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/^(?:\+?1\h?)?(\()?\d{3}(?(1)\))([-. ]?)\d{3}\2\d{4}$/m'; $str = '589-845-2889 (589)-845-2889 589.845.2889 589 845 2889 5898452889 (589) 845 2889 1(589) 845 2889 +1(589) 845 2889 1589 845 2889 1 589 845 2889 15898452889 +1207 244 7002 +1 207 244 7002 (589) 845-2889 +1(589) 845-2889 1(589) 845-2889'; preg_match_all($re, $str, $matches); print_r($matches[0]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rtNQt
function name:  (null)
number of ops:  12
compiled vars:  !0 = $re, !1 = $str, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%5E%28%3F%3A%5C%2B%3F1%5Ch%3F%29%3F%28%5C%28%29%3F%5Cd%7B3%7D%28%3F%281%29%5C%29%29%28%5B-.+%5D%3F%29%5Cd%7B3%7D%5C2%5Cd%7B4%7D%24%2Fm'
    4     1        ASSIGN                                                   !1, '589-845-2889%0A%28589%29-845-2889%0A589.845.2889%0A589+845+2889%0A5898452889%0A%28589%29+845+2889%0A1%28589%29+845+2889%0A%2B1%28589%29+845+2889%0A1589+845+2889%0A1+589+845+2889%0A15898452889%0A%2B1207+244+7002%0A%2B1+207+244+7002%0A%28589%29+845-2889%0A%2B1%28589%29+845-2889%0A1%28589%29+845-2889'
   20     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
   21     7        INIT_FCALL                                               'print_r'
          8        FETCH_DIM_R                                      ~6      !2, 0
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.59 ms | 998 KiB | 15 Q