3v4l.org

run code in 300+ PHP versions simultaneously
<?php print get_domain("somedomain.co.uk"); // outputs 'somedomain.co.uk' function get_domain($domain) { if (preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs)) { return $regs['domain']; } return false; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hTciL
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       'get_domain'
          1        SEND_VAL_EX                                              'somedomain.co.uk'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   10     4      > RETURN                                                   1

Function get_domain:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hTciL
function name:  get_domain
number of ops:  11
compiled vars:  !0 = $domain, !1 = $regs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%28%3FP%3Cdomain%3E%5Ba-z0-9%5D%5Ba-z0-9%5C-%5D%7B1%2C63%7D%5C.%5Ba-z%5C.%5D%7B2%2C6%7D%29%24%2Fi'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $2      
          6      > JMPZ                                                     $2, ->9
    7     7    >   FETCH_DIM_R                                      ~3      !1, 'domain'
          8      > RETURN                                                   ~3
    9     9    > > RETURN                                                   <false>
   10    10*     > RETURN                                                   null

End of function get_domain

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.44 ms | 1395 KiB | 15 Q