3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'fd.com..ec'; $pattern = '/^[A-Z0-9.-]+\.[A-Z]{2,}\b/i'; var_dump(preg_match($pattern, $str)); /*function validaEmailUsername($str){ $allowed = array("-", ".", "_"); // you can add here more value, you want to allow. $regExp = implode($allowed); $str = trim($str); //valido inicio y fin del username no tenga .-_ if( (preg_match('/^['.$regExp.']|['.$regExp.']$/i', $str) == 0) && (strlen($str) > 5) ) { $count_special_char = preg_match_all("/[".$regExp."]/i", $str, $matches); if( ctype_alnum(str_replace($allowed, '', $str )) && ($count_special_char == 0 || $count_special_char == 1) ){ $badWords = array("usuario","user","test","demo","notiene", "prueba", ".com", ".net"); $matches = array(); $matchFound = preg_match_all("/\b(" . implode($badWords,"|") . ")\b/i", $str, $matches); if ($matchFound){ return false; } return true; } } return false; }*/
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1W12b
function name:  (null)
number of ops:  10
compiled vars:  !0 = $str, !1 = $pattern
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'fd.com..ec'
    3     1        ASSIGN                                                   !1, '%2F%5E%5BA-Z0-9.-%5D%2B%5C.%5BA-Z%5D%7B2%2C%7D%5Cb%2Fi'
    4     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'preg_match'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
   24     9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.95 ms | 1393 KiB | 17 Q