3v4l.org

run code in 500+ PHP versions simultaneously
<?php $url = 'https://example.com/pathurl'; $bits = parse_url($url); $sub = strtok($bits['host'], '.'); echo $sub . PHP_EOL; $url = 'https://subdomain.example.com/pathurl'; $bits = parse_url($url); $sub = strtok($bits['host'], '.'); echo $sub . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ClIW0
function name:  (null)
number of ops:  27
compiled vars:  !0 = $url, !1 = $bits, !2 = $sub
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'https%3A%2F%2Fexample.com%2Fpathurl'
    4     1        INIT_FCALL                                                   'parse_url'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $4      
          4        ASSIGN                                                       !1, $4
    5     5        INIT_FCALL                                                   'strtok'
          6        FETCH_DIM_R                                          ~6      !1, 'host'
          7        SEND_VAL                                                     ~6
          8        SEND_VAL                                                     '.'
          9        DO_ICALL                                             $7      
         10        ASSIGN                                                       !2, $7
    6    11        CONCAT                                               ~9      !2, '%0A'
         12        ECHO                                                         ~9
    8    13        ASSIGN                                                       !0, 'https%3A%2F%2Fsubdomain.example.com%2Fpathurl'
    9    14        INIT_FCALL                                                   'parse_url'
         15        SEND_VAR                                                     !0
         16        DO_ICALL                                             $11     
         17        ASSIGN                                                       !1, $11
   10    18        INIT_FCALL                                                   'strtok'
         19        FETCH_DIM_R                                          ~13     !1, 'host'
         20        SEND_VAL                                                     ~13
         21        SEND_VAL                                                     '.'
         22        DO_ICALL                                             $14     
         23        ASSIGN                                                       !2, $14
   11    24        CONCAT                                               ~16     !2, '%0A'
         25        ECHO                                                         ~16
   12    26      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166 ms | 1855 KiB | 15 Q