3v4l.org

run code in 300+ PHP versions simultaneously
<?php function file_uri_scheme($uri) { $position = strpos($uri, '://'); return $position ? substr($uri, 0, $position) : FALSE; } function file_uri_target($uri) { $data = explode('://', $uri, 2); // Remove erroneous leading or trailing, forward-slashes and backslashes. return count($data) == 2 ? trim($data[1], '\/') : FALSE; } function file_stream_wrapper_uri_normalize($uri) { $scheme = file_uri_scheme($uri); if ($scheme) { $target = file_uri_target($uri); if ($target !== FALSE) { $uri = $scheme . '://' . $target; } } return $uri; } $uri = 'private://test/example.exe'; echo file_stream_wrapper_uri_normalize($uri);
Output for git.master, git.master_jit, rfc.property-hooks
private://test/example.exe

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