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