3v4l.org

run code in 500+ PHP versions simultaneously
<?php preg_match('/^[^.]*\.(?=\w+\.\w+$)/','subdomain.example.com',$matches); $subdomain = isset($matches[0]) ? trim($matches[0],'.') : ''; echo $subdomain;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dOdAH
function name:  (null)
number of ops:  15
compiled vars:  !0 = $matches, !1 = $subdomain
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'preg_match'
          1        SEND_VAL                                                     '%2F%5E%5B%5E.%5D%2A%5C.%28%3F%3D%5Cw%2B%5C.%5Cw%2B%24%29%2F'
          2        SEND_VAL                                                     'subdomain.example.com'
          3        SEND_REF                                                     !0
          4        DO_ICALL                                                     
    5     5        ISSET_ISEMPTY_DIM_OBJ                             0          !0, 0
          6      > JMPZ                                                         ~3, ->11
          7    >   FETCH_DIM_R                                          ~4      !0, 0
          8        FRAMELESS_ICALL_2                trim                ~5      ~4, '.'
          9        QM_ASSIGN                                            ~6      ~5
         10      > JMP                                                          ->12
         11    >   QM_ASSIGN                                            ~6      ''
         12    >   ASSIGN                                                       !1, ~6
    7    13        ECHO                                                         !1
    8    14      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.43 ms | 1852 KiB | 14 Q