]> granicus.if.org Git - php/commitdiff
Remove useless check in substr()
authorThomas Punt <tpunt@hotmail.co.uk>
Wed, 11 Nov 2015 22:13:57 +0000 (22:13 +0000)
committerThomas Punt <tpunt@hotmail.co.uk>
Wed, 11 Nov 2015 22:13:57 +0000 (22:13 +0000)
This check (if the start position is greater than the string length) is already performed on line 2399

ext/standard/string.c

index 3d5b76caa2d314dca21e1c90f2005f199aa44464..3922ff497d67e6e7c694ba93fc98cb7fad250a74 100644 (file)
@@ -2426,10 +2426,6 @@ PHP_FUNCTION(substr)
                }
        }
 
-       if (f > (zend_long)ZSTR_LEN(str)) {
-               RETURN_FALSE;
-       }
-
        if ((f + l) > (zend_long)ZSTR_LEN(str)) {
                l = ZSTR_LEN(str) - f;
        }