3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = "http://carkva-gazeta.org/римско-католическая-церковь/"; // in case it is https, we don't want to hardcode http $scheme = parse_url($url, PHP_URL_SCHEME); $host = parse_url($url, PHP_URL_HOST); // do not encode the first '/' or the last '/' $encodedPath = strtolower(urlencode(substr(parse_url($url, PHP_URL_PATH), 1, -1))); $encodedUrl = $scheme . "://" . $host . "/" . $encodedPath . "/"; echo $encodedUrl;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ck5Sv
function name:  (null)
number of ops:  35
compiled vars:  !0 = $url, !1 = $scheme, !2 = $host, !3 = $encodedPath, !4 = $encodedUrl
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fcarkva-gazeta.org%2F%D1%80%D0%B8%D0%BC%D1%81%D0%BA%D0%BE-%D0%BA%D0%B0%D1%82%D0%BE%D0%BB%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B0%D1%8F-%D1%86%D0%B5%D1%80%D0%BA%D0%BE%D0%B2%D1%8C%2F'
    6     1        INIT_FCALL                                               'parse_url'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    7     6        INIT_FCALL                                               'parse_url'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 1
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !2, $8
    9    11        INIT_FCALL                                               'strtolower'
         12        INIT_FCALL                                               'urlencode'
         13        INIT_FCALL                                               'substr'
         14        INIT_FCALL                                               'parse_url'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 5
         17        DO_ICALL                                         $10     
         18        SEND_VAR                                                 $10
         19        SEND_VAL                                                 1
         20        SEND_VAL                                                 -1
         21        DO_ICALL                                         $11     
         22        SEND_VAR                                                 $11
         23        DO_ICALL                                         $12     
         24        SEND_VAR                                                 $12
         25        DO_ICALL                                         $13     
         26        ASSIGN                                                   !3, $13
   11    27        CONCAT                                           ~15     !1, '%3A%2F%2F'
         28        CONCAT                                           ~16     ~15, !2
         29        CONCAT                                           ~17     ~16, '%2F'
         30        CONCAT                                           ~18     ~17, !3
         31        CONCAT                                           ~19     ~18, '%2F'
         32        ASSIGN                                                   !4, ~19
   13    33        ECHO                                                     !4
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.43 ms | 1388 KiB | 21 Q