3v4l.org

run code in 300+ PHP versions simultaneously
<?php function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);} $base_uri = 'http://localhost/symfony-standard/app_dev.php'; $base_uri_with_trailing_slash = $base_uri . '/'; $generate_uri = function($path) use ($base_uri) { return $base_uri . $path; }; $correctly_generate_uri = function($path, $base_uri) { $fix_path_for_base_uri = function ($path) use ($base_uri) { if ($path === '/') { return ''; } if (strlen($base_uri) === strrpos($base_uri, '/')+1) { return substr($path, 1); } return $path; }; return $base_uri . $fix_path_for_base_uri($path); }; print "\nBroken\n\n"; it( 'generates the expected uri: http://localhost/symfony-standard/app_dev.php', $base_uri === $generate_uri('/', $base_uri) ); it( 'generates the expected uri: http://localhost/symfony-standard/app_dev.php/foo', $base_uri.'/foo' === $generate_uri('/foo', $base_uri) ); print "\nNot Broken\n\n"; it( 'correctly generates the expected uri: http://localhost/symfony-standard/app_dev.php', $base_uri === $correctly_generate_uri('/', $base_uri) ); it( 'generates the expected uri: http://localhost/symfony-standard/app_dev.php/foo', $base_uri.'/foo' === $correctly_generate_uri('/foo', $base_uri) ); it( 'correctly generates the expected uri: http://localhost/symfony-standard/app_dev.php/', $base_uri_with_trailing_slash === $correctly_generate_uri('/', $base_uri_with_trailing_slash) ); it( 'correctly generates the expected uri: http://localhost/symfony-standard/app_dev.php/foo', $base_uri.'/foo' === $correctly_generate_uri('/foo', $base_uri_with_trailing_slash) );
Output for git.master, git.master_jit, rfc.property-hooks
Broken ✘ It generates the expected uri: http://localhost/symfony-standard/app_dev.php ✔︎ It generates the expected uri: http://localhost/symfony-standard/app_dev.php/foo Not Broken ✔︎ It correctly generates the expected uri: http://localhost/symfony-standard/app_dev.php ✔︎ It generates the expected uri: http://localhost/symfony-standard/app_dev.php/foo ✔︎ It correctly generates the expected uri: http://localhost/symfony-standard/app_dev.php/ ✔︎ It correctly generates the expected uri: http://localhost/symfony-standard/app_dev.php/foo

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:
42.76 ms | 407 KiB | 5 Q