|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-02-05 22:38 UTC] miqrogroove at gmail dot com
Description: ------------ --- From manual page: http://www.php.net/function.substr#Changelog --- According to the "Changelog" this function should return FALSE for substr('abc', - 7) in 5.2.2+. The actual return value is 'abc' in version 5.2.16. Did not test 5.2.17, but the manual is obviously wrong. Test script: --------------- echo substr('abc', -7); Expected result: ---------------- No output. Actual result: -------------- abc PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 03:00:02 2026 UTC |
The changelog used to refer to the behaviour in cases such as substr('abc',2,-2). As detailed in the changelog before today's amendment, prior to 5.2.2 that case returns an empty string and otherwise returns false. The change in behaviour for the substr('abc',-7) case should be detailed separately.Old changelog was wrong. substr("abc", -7) returns "abc" in PHP 5.1.6.