[RFC]strn(case)cmp supporting negative length as third parameter
| From: | Laruence | Date: | Thu, 28 Jul 2011 04:58:01 +0000 |
| Subject: | [RFC]strn(case)cmp supporting negative length as third parameter | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-54226@lists.php.net to get a copy of this message | ||
Hi:
strn(case)cmp dosen't support a negative length as its third
paramter, while substr dose.
I wrote a patch to make strn(case)cmp supporting negative length,
make following script works as expect:
<?php
if (strncmp("prefix_num", "num", -3) === 0) {
echo "they have same suffix\n";
}
?>
here is the rfc: https://wiki.php.net/rfc/strncmpnegativelen
any question? plz worte me back.
thanks
--
Laruence Xinchen Hui
http://www.laruence.com/