3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(substr('abcde', 2, -3)); var_dump(substr('abcde', 2, -4)); var_dump(substr('ab', 2)); var_dump(substr('ab', 3)); var_dump(substr('ab', 0, -2)); var_dump(substr('ab', 0, -3));
Output for 7.0.0 - 7.1.0
string(0) "" bool(false) string(0) "" bool(false) string(0) "" bool(false)
Output for 5.2.2 - 5.6.28
string(0) "" bool(false) bool(false) bool(false) string(0) "" bool(false)
Output for 4.3.0 - 5.2.1
string(0) "" string(0) "" bool(false) bool(false) string(0) "" string(0) ""