3v4l.org

run code in 300+ PHP versions simultaneously
<?php function absolute_path($base, $relative) { list($stack, $parts) = [explode('/', $base), explode('/', $relative)]; array_pop($stack); for ($i = 0; $i < count($parts); $i++) { if ($parts[$i] == '') continue; elseif ($parts[$i] == '..') array_pop($stack); else array_push($stack, $parts[$i]); } return join('/', $stack); } echo absolute_path( 'http://mhelper.ru/project/dev/works/ElenaBeauty/index.html', '../../css/reset.css' );
Output for git.master, git.master_jit, rfc.property-hooks
http://mhelper.ru/project/dev/css/reset.css

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:
53.73 ms | 401 KiB | 8 Q