3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parse($url) { $path = parse_url($url, PHP_URL_PATH); $parts = explode('/', $path); $parts = array_slice($parts, -6); $path = implode('/', $parts); var_dump($path); } parse('https://www.random.vov/part1/part2/part3/2016/08/file.pdf'); parse('https://www.random.ccc/random2/part1/part2/part3/2017/08/file.txt');
Output for git.master, git.master_jit, rfc.property-hooks
string(34) "part1/part2/part3/2016/08/file.pdf" string(34) "part1/part2/part3/2017/08/file.txt"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
38.01 ms | 405 KiB | 5 Q