3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($check) { $rx = '_^(https?)://([^:/?]+)(?::(\d+))?(?:(/[^?]+))?(?:\?(.*))?$_i'; echo "Test $check\n"; if (!preg_match($rx, $check, $m)) { echo "\tFAIL!\n"; } else { var_export($m); echo "\n"; } } test(''); test('http://www.example.com'); test('http://www.example.com:8080'); test('http://www.example.com/some/path'); test('http://www.example.com:8080/some/path'); test('http://www.example.com?queryString'); test('http://www.example.com/some/path?queryString'); test('http://www.example.com:8080/some/path?queryString');
Output for git.master, git.master_jit, rfc.property-hooks
Test FAIL! Test http://www.example.com array ( 0 => 'http://www.example.com', 1 => 'http', 2 => 'www.example.com', ) Test http://www.example.com:8080 array ( 0 => 'http://www.example.com:8080', 1 => 'http', 2 => 'www.example.com', 3 => '8080', ) Test http://www.example.com/some/path array ( 0 => 'http://www.example.com/some/path', 1 => 'http', 2 => 'www.example.com', 3 => '', 4 => '/some/path', ) Test http://www.example.com:8080/some/path array ( 0 => 'http://www.example.com:8080/some/path', 1 => 'http', 2 => 'www.example.com', 3 => '8080', 4 => '/some/path', ) Test http://www.example.com?queryString array ( 0 => 'http://www.example.com?queryString', 1 => 'http', 2 => 'www.example.com', 3 => '', 4 => '', 5 => 'queryString', ) Test http://www.example.com/some/path?queryString array ( 0 => 'http://www.example.com/some/path?queryString', 1 => 'http', 2 => 'www.example.com', 3 => '', 4 => '/some/path', 5 => 'queryString', ) Test http://www.example.com:8080/some/path?queryString array ( 0 => 'http://www.example.com:8080/some/path?queryString', 1 => 'http', 2 => 'www.example.com', 3 => '8080', 4 => '/some/path', 5 => 'queryString', )

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:
57.51 ms | 403 KiB | 8 Q