3v4l.org

run code in 300+ PHP versions simultaneously
<?php $page_uri = 'http://www.example.com/some_path/to/'; $path_parts = pathinfo($page_uri); if (!isset($path_parts['extension']) && strlen($page_uri) > 1) { $end = substr($page_uri, -1, 1); $page_uri_slash_fixed = (($end == '/') ? substr($page_uri, 0, -1) : $page_uri . '/'); } echo $page_uri; echo $page_uri_slash_fixed;
Output for git.master, git.master_jit, rfc.property-hooks
http://www.example.com/some_path/to/http://www.example.com/some_path/to

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