3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rocket______get_domain( $url ) { if ( is_object( $url ) ) { $url = $url->post_title; } $url = str_replace( array( 'http://', 'https://' ), '', $url ); $url = 'http://'.$url; $urlobj = parse_url( str_replace( 'www.', '', $url ) ); $domain = $urlobj['host']; $return = false; if( preg_match( '/(?P<domain>[a-z0-9\-]{1,63}\.[a-z\.]{2,5})$/i', $domain, $regs ) ) // julio le 06/05/15 $return = $regs['domain']; if ( 'dev' == pathinfo( $return, PATHINFO_EXTENSION ) || 'localhost' == $return ) return false; return $return; } var_dump( rocket______get_domain( 'http://dq.dev' ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MQ7UO
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'rocket______get_domain'
          2        SEND_VAL                                                 'http%3A%2F%2Fdq.dev'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function rocket______get_domain:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
2 jumps found. (Code = 47) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 43
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
Branch analysis from position: 33
Branch analysis from position: 5
filename:       /in/MQ7UO
function name:  rocket______get_domain
number of ops:  45
compiled vars:  !0 = $url, !1 = $urlobj, !2 = $domain, !3 = $return, !4 = $regs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        TYPE_CHECK                                  256          !0
          2      > JMPZ                                                     ~5, ->5
    6     3    >   FETCH_OBJ_R                                      ~6      !0, 'post_title'
          4        ASSIGN                                                   !0, ~6
    8     5    >   INIT_FCALL                                               'str_replace'
          6        SEND_VAL                                                 <array>
          7        SEND_VAL                                                 ''
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !0, $8
    9    11        CONCAT                                           ~10     'http%3A%2F%2F', !0
         12        ASSIGN                                                   !0, ~10
   10    13        INIT_FCALL                                               'parse_url'
         14        INIT_FCALL                                               'str_replace'
         15        SEND_VAL                                                 'www.'
         16        SEND_VAL                                                 ''
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $12     
         19        SEND_VAR                                                 $12
         20        DO_ICALL                                         $13     
         21        ASSIGN                                                   !1, $13
   11    22        FETCH_DIM_R                                      ~15     !1, 'host'
         23        ASSIGN                                                   !2, ~15
   12    24        ASSIGN                                                   !3, <false>
   13    25        INIT_FCALL                                               'preg_match'
         26        SEND_VAL                                                 '%2F%28%3FP%3Cdomain%3E%5Ba-z0-9%5C-%5D%7B1%2C63%7D%5C.%5Ba-z%5C.%5D%7B2%2C5%7D%29%24%2Fi'
         27        SEND_VAR                                                 !2
         28        SEND_REF                                                 !4
         29        DO_ICALL                                         $18     
         30      > JMPZ                                                     $18, ->33
   14    31    >   FETCH_DIM_R                                      ~19     !4, 'domain'
         32        ASSIGN                                                   !3, ~19
   15    33    >   INIT_FCALL                                               'pathinfo'
         34        SEND_VAR                                                 !3
         35        SEND_VAL                                                 4
         36        DO_ICALL                                         $21     
         37        IS_EQUAL                                         ~22     $21, 'dev'
         38      > JMPNZ_EX                                         ~22     ~22, ->41
         39    >   IS_EQUAL                                         ~23     !3, 'localhost'
         40        BOOL                                             ~22     ~23
         41    > > JMPZ                                                     ~22, ->43
   16    42    > > RETURN                                                   <false>
   17    43    > > RETURN                                                   !3
   18    44*     > RETURN                                                   null

End of function rocket______get_domain

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
310.5 ms | 1403 KiB | 25 Q