3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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); $encodedPath = urlencode(substr(parse_url($url, PHP_URL_PATH), 1)); $encodedUrl = $scheme . "://" . $host . "/" . $encodedPath; echo $encodedUrl;
Output for 5.1.2 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
http://carkva-gazeta.org/%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
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 5.1.1
Notice: Use of undefined constant PHP_URL_SCHEME - assumed 'PHP_URL_SCHEME' in /in/6mWQl on line 6 Warning: parse_url() expects exactly 1 parameter, 2 given in /in/6mWQl on line 6 Notice: Use of undefined constant PHP_URL_HOST - assumed 'PHP_URL_HOST' in /in/6mWQl on line 7 Warning: parse_url() expects exactly 1 parameter, 2 given in /in/6mWQl on line 7 Notice: Use of undefined constant PHP_URL_PATH - assumed 'PHP_URL_PATH' in /in/6mWQl on line 8 Warning: parse_url() expects exactly 1 parameter, 2 given in /in/6mWQl on line 8 :///