3v4l.org

run code in 500+ PHP versions simultaneously
<?php $re = '/^(?:\+?1\h?)?(?:(\()?\d{3}(?(1)\))([-. ]?)\d{3}\2\d{4}|\d{11})$/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'; 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/io1cm
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%3F%3A%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%7C%5Cd%7B11%7D%29%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'
   18     2        INIT_FCALL                                                   'preg_match_all'
          3        SEND_VAR                                                     !0
          4        SEND_VAR                                                     !1
          5        SEND_REF                                                     !2
          6        DO_ICALL                                                     
   19     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.5.0


preferences:
163.73 ms | 2093 KiB | 15 Q