3v4l.org

run code in 300+ PHP versions simultaneously
<?php $example = 'your string here, please/do it by yourself.'; $expected = 'your string here, do it by yourself.'; $slashPos = strpos($example, '/'); $spacePos = strrpos($example, ' ', -1 * $slashPos); $string1 = substr($example, 0, $spacePos + 1); $string2 = substr($example, (strlen($example) - $slashPos - 1) * -1); $result = $string1 . $string2; var_dump(assert($expected === $result));
Output for git.master, git.master_jit, rfc.property-hooks
bool(true)

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:
28.23 ms | 405 KiB | 5 Q