3v4l.org

run code in 300+ PHP versions simultaneously
<?php $current_url_host = 'sub.example.com'; $main_url_host = 'example.com'; $current_url_host_rev = strrev( $current_url_host ); $main_url_host_rev = strrev( $main_url_host ); if ( strpos( $current_url_host_rev, $main_url_host_rev ) === 0 ) { $current_url_host_rev = trim( substr( $current_url_host_rev, strlen( $main_url_host_rev ) ), '.' ); } $current_url_sub_domains = strrev( $main_url_host_rev ); echo $main_url_host_rev;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 26
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/YLkiV
function name:  (null)
number of ops:  32
compiled vars:  !0 = $current_url_host, !1 = $main_url_host, !2 = $current_url_host_rev, !3 = $main_url_host_rev, !4 = $current_url_sub_domains
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'sub.example.com'
    3     1        ASSIGN                                                   !1, 'example.com'
    5     2        INIT_FCALL                                               'strrev'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !2, $7
    6     6        INIT_FCALL                                               'strrev'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !3, $9
    8    10        INIT_FCALL                                               'strpos'
         11        SEND_VAR                                                 !2
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $11     
         14        IS_IDENTICAL                                             $11, 0
         15      > JMPZ                                                     ~12, ->26
    9    16    >   INIT_FCALL                                               'trim'
         17        INIT_FCALL                                               'substr'
         18        SEND_VAR                                                 !2
         19        STRLEN                                           ~13     !3
         20        SEND_VAL                                                 ~13
         21        DO_ICALL                                         $14     
         22        SEND_VAR                                                 $14
         23        SEND_VAL                                                 '.'
         24        DO_ICALL                                         $15     
         25        ASSIGN                                                   !2, $15
   12    26    >   INIT_FCALL                                               'strrev'
         27        SEND_VAR                                                 !3
         28        DO_ICALL                                         $17     
         29        ASSIGN                                                   !4, $17
   14    30        ECHO                                                     !3
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.28 ms | 1396 KiB | 21 Q