3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.65 ms | 1396 KiB | 21 Q