3v4l.org

run code in 500+ PHP versions simultaneously
<?php $telefones = ['(11) 5550 - 5550', '(11) 96660 - 6660', '(11) 90000 - 0000']; foreach ($telefones as $telefone){ $regex = '/^\(([0-9]{2})\) (9?[0-9]{4} - [0-9]{4})$/'; $telefoneValido = preg_match ( $regex, $telefone ); if ($telefoneValido){ echo 'Telefone Valido'.PHP_EOL; } else echo 'Telefone Invalido'.PHP_EOL; echo preg_replace( $regex, '(XX) \2', $telefone .PHP_EOL ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/WLdCY
function name:  (null)
number of ops:  17
compiled vars:  !0 = $telefones, !1 = $telefone, !2 = $regex, !3 = $telefoneValido
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    5     1      > FE_RESET_R                                           $5      !0, ->15
          2    > > FE_FETCH_R                                                   $5, !1, ->15
    7     3    >   ASSIGN                                                       !2, '%2F%5E%5C%28%28%5B0-9%5D%7B2%7D%29%5C%29+%289%3F%5B0-9%5D%7B4%7D+-+%5B0-9%5D%7B4%7D%29%24%2F'
    9     4        FRAMELESS_ICALL_2                preg_match          ~7      !2, !1
          5        ASSIGN                                                       !3, ~7
   15     6      > JMPZ                                                         !3, ->9
   16     7    >   ECHO                                                         'Telefone+Valido%0A'
   15     8      > JMP                                                          ->10
   17     9    >   ECHO                                                         'Telefone+Invalido%0A'
   23    10    >   CONCAT                                               ~9      !1, '%0A'
   20    11        FRAMELESS_ICALL_3                preg_replace        ~10     !2, '%28XX%29+%5C2'
   23    12        OP_DATA                                                      ~9
         13        ECHO                                                         ~10
    5    14      > JMP                                                          ->2
         15    >   FE_FREE                                                      $5
   25    16      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.18 ms | 1719 KiB | 13 Q