3v4l.org

run code in 300+ PHP versions simultaneously
<?php $current_url = 'foo.bar.baz.com'; $current_domains = explode( '.', $current_url ); $current_top_domain = array_slice( $current_domains, count( $current_domains ) - 2 ); echo implode( '.', $current_top_domain );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ve4Ag
function name:  (null)
number of ops:  19
compiled vars:  !0 = $current_url, !1 = $current_domains, !2 = $current_top_domain
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'foo.bar.baz.com'
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '.'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    6     6        INIT_FCALL                                               'array_slice'
          7        SEND_VAR                                                 !1
          8        COUNT                                            ~6      !1
          9        SUB                                              ~7      ~6, 2
         10        SEND_VAL                                                 ~7
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !2, $8
    8    13        INIT_FCALL                                               'implode'
         14        SEND_VAL                                                 '.'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $10     
         17        ECHO                                                     $10
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.93 ms | 1394 KiB | 19 Q