3v4l.org

run code in 300+ PHP versions simultaneously
<?php $urlPath = parse_url('http://tvil.ru/city/gelendzhik/hotels/341229/', PHP_URL_PATH); $pathParts = explode('/', $urlPath); $pathParts = array_unique($pathParts); var_dump($pathParts);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TPfLR
function name:  (null)
number of ops:  18
compiled vars:  !0 = $urlPath, !1 = $pathParts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'parse_url'
          1        SEND_VAL                                                 'http%3A%2F%2Ftvil.ru%2Fcity%2Fgelendzhik%2Fhotels%2F341229%2F'
          2        SEND_VAL                                                 5
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
    4     5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '%2F'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !1, $4
    5    10        INIT_FCALL                                               'array_unique'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $6      
         13        ASSIGN                                                   !1, $6
    7    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.78 ms | 1394 KiB | 21 Q