3v4l.org

run code in 300+ PHP versions simultaneously
<?php # It is NOT OK to start reading past the end of the string, no, no. Bad programmer. var_dump(substr("a", 1)); # But it is OK to ask for a bigger slice than the length of the string. var_dump(substr("a", 0, 10)); # It is also OK to read past the begining of the string, why not. var_dump(substr("a", -1)); var_dump(substr("a", -2)); # On the other hand, it is NOT OK to stop reading before the end of the string. Bad programmer. var_dump(substr("a", 0, -2));
Output for git.master, git.master_jit, rfc.property-hooks
string(0) "" string(1) "a" string(1) "a" string(1) "a" string(0) ""

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