Code Duplication    Length = 3-3 lines in 2 locations

src/string.php 2 locations

@@ 202-204 (lines=3) @@
199
     */
200
    function ends_with($haystack, $needles)
201
    {
202
        if ($haystack === null || $haystack == '' || $needles === null || $needles == '') {
203
            return false;
204
        }
205
206
        foreach ((array)$needles as $needle) {
207
            if ((string)$needle === substr($haystack, -strlen($needle))) {
@@ 225-227 (lines=3) @@
222
     */
223
    function starts_with($haystack, $needles)
224
    {
225
        if ($haystack === null || $haystack == '' || $needles === null || $needles == '') {
226
            return false;
227
        }
228
229
        foreach ((array)$needles as $needle) {
230
            if ($needle != '' && strpos($haystack, $needle) === 0) {