diff --git a/src/N98/Util/BinaryString.php b/src/N98/Util/BinaryString.php index b10ea40b1..7415a391f 100644 --- a/src/N98/Util/BinaryString.php +++ b/src/N98/Util/BinaryString.php @@ -27,9 +27,26 @@ public static function trimExplodeEmpty($delimiter, $string) * @param string $needle * * @return bool + * + * @deprecated use str_starts_with() instead */ public static function startsWith($haystack, $needle) { - return $needle === '' || strpos($haystack, $needle) === 0; + trigger_error(__METHOD__ . ' is obsolete, use str_starts_with', E_USER_DEPRECATED); + return str_starts_with($haystack, $needle); + } + + /** + * @param string $haystack + * @param string $needle + * + * @return bool + * + * @deprecated use str_ends_with() instead + */ + public static function endsWith($haystack, $needle) + { + trigger_error(__METHOD__ . ' is obsolete, use str_ends_with()', E_USER_DEPRECATED); + return str_ends_with($haystack, $needle); } }