3v4l.org

run code in 500+ PHP versions simultaneously
<?php $domainsToCheck = ["example3000.com", "m.example3000.com"]; function checkDomain($domain) { if (preg_match('/^([\p{L}\d\-]+)\.((?:[\p{L}\-]+\.?)+)$/ui', $domain, $m) === 1) { echo "{$domain} is good" . PHP_EOL; } else { echo "{$domain} is bad" . PHP_EOL; } } foreach ($domainsToCheck as $domain) { checkDomain($domain); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/KdAMn
function name:  (null)
number of ops:  9
compiled vars:  !0 = $domainsToCheck, !1 = $domain
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   13     1      > FE_RESET_R                                           $3      !0, ->7
          2    > > FE_FETCH_R                                                   $3, !1, ->7
   14     3    >   INIT_FCALL                                                   'checkdomain'
          4        SEND_VAR                                                     !1
          5        DO_FCALL                                          0          
   13     6      > JMP                                                          ->2
          7    >   FE_FREE                                                      $3
   15     8      > RETURN                                                       1

Function checkdomain:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KdAMn
function name:  checkDomain
number of ops:  18
compiled vars:  !0 = $domain, !1 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    6     1        INIT_FCALL                                                   'preg_match'
          2        SEND_VAL                                                     '%2F%5E%28%5B%5Cp%7BL%7D%5Cd%5C-%5D%2B%29%5C.%28%28%3F%3A%5B%5Cp%7BL%7D%5C-%5D%2B%5C.%3F%29%2B%29%24%2Fui'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                             $2      
          6        IS_IDENTICAL                                                 $2, 1
          7      > JMPZ                                                         ~3, ->13
    7     8    >   NOP                                                          
          9        FAST_CONCAT                                          ~4      !0, '+is+good'
         10        CONCAT                                               ~5      ~4, '%0A'
         11        ECHO                                                         ~5
    6    12      > JMP                                                          ->17
    9    13    >   NOP                                                          
         14        FAST_CONCAT                                          ~6      !0, '+is+bad'
         15        CONCAT                                               ~7      ~6, '%0A'
         16        ECHO                                                         ~7
   11    17    > > RETURN                                                       null

End of function checkdomain

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
235.2 ms | 3017 KiB | 15 Q