3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function endswith($haystack, $needle) { $length = strlen($needle); if ($length == 0) { return true; } return (substr($haystack, -$length) === $needle); } if (version_compare(phpversion(), '5.1.0', '>')) { var_dump(endswith("abcdefg", "abc")); }
based on qGYBH
Output for 5.1.1 - 7.2.0
bool(false)
Output for 4.3.0 - 5.1.0