3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ReformatPhoneNumber($number) { $isValid = preg_match('/^(\d[ |-]*){6,11}\d$/i', $number, $result); if(!$isValid) { //throw new Exception('Division by zero.'); } return str_replace(array(' ' , '-'), array('', ''), $number); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G73R3
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   1

Function reformatphonenumber:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/G73R3
function name:  ReformatPhoneNumber
number of ops:  16
compiled vars:  !0 = $number, !1 = $isValid, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%5E%28%5Cd%5B+%7C-%5D%2A%29%7B6%2C11%7D%5Cd%24%2Fi'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !2
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
    5     7        BOOL_NOT                                         ~5      !1
          8      > JMPZ                                                     ~5, ->9
    8     9    >   INIT_FCALL                                               'str_replace'
         10        SEND_VAL                                                 <array>
         11        SEND_VAL                                                 <array>
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $6      
         14      > RETURN                                                   $6
    9    15*     > RETURN                                                   null

End of function reformatphonenumber

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.84 ms | 1395 KiB | 17 Q