3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($DIRECTORY_SEPARATOR, $source, $path, $expected) { $folder = str_replace(rtrim($source, $DIRECTORY_SEPARATOR), '', dirname($path)); echo "Expected: $expected\n"; echo "Actual: $folder\n"; echo "--------------\n"; } test('/', '/site/path', '/site/path/backed/up/item.txt', '/backed/up'); test('/', '/site/path/', '/site/path/backed/up/item.txt', '/backed/up'); test('\\', 'C:\\site\\path', 'C:/site/path/backed/up/item.txt', '/backed/up'); test('\\', 'C:\\site\\path\\', 'C:/site/path/backed/up/item.txt', '/backed/up'); test('\\', 'C:/site/path', 'C:/site/path/backed/up/item.txt', '/backed/up'); test('\\', 'C:/site/path/', 'C:/site/path/backed/up/item.txt', '/backed/up');
Output for git.master, git.master_jit, rfc.property-hooks
Expected: /backed/up Actual: /backed/up -------------- Expected: /backed/up Actual: /backed/up -------------- Expected: /backed/up Actual: C:/site/path/backed/up -------------- Expected: /backed/up Actual: C:/site/path/backed/up -------------- Expected: /backed/up Actual: /backed/up -------------- Expected: /backed/up Actual: backed/up --------------

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:
26.43 ms | 406 KiB | 5 Q