|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-02-10 10:58 UTC] rquadling@php.net
[2010-02-11 11:18 UTC] rquadling@php.net
[2010-02-11 11:18 UTC] svn@php.net
[2020-02-07 06:09 UTC] phpdocbot@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 16:00:01 2025 UTC |
Description: ------------ The documentation for substr_compare() indicates that the default value for the $length parameter is the string length of the $main_str parameter, but this doesn't appear to be the case. Reproduce code: --------------- --- From manual page: function.substr-compare#Description --- <?php $a = "abc123"; $b = "abc"; echo "Is the documentation correct? "; echo ((substr_compare($b, $a, 0) == (substr_compare($b, $a, 0, strlen($b)))) ? 'true' : 'false'); echo "\n"; ?> Expected result: ---------------- Is the documentation correct? true Actual result: -------------- Is the documentation correct? false