rfc:strncmpnegativelen
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:strncmpnegativelen [2011/07/28 11:56] – [Proposal] laruence | rfc:strncmpnegativelen [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2011-07-28 | * Date: 2011-07-28 | ||
* Author: Xinchen Hui < | * Author: Xinchen Hui < | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
Line 22: | Line 22: | ||
</ | </ | ||
- | but we know substr supports a negative length | + | We need to write some codes like following one to make it works as expect: |
<code php> | <code php> | ||
<?php | <?php | ||
- | echo substr(" | + | if (strncmp(substr(" |
+ | echo "they have same suffix\n" | ||
+ | } | ||
+ | ?> | ||
</ | </ | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | base on featurn | + | base on feature |
after patched, following script: | after patched, following script: | ||
Line 46: | Line 49: | ||
<code php> | <code php> | ||
<?php | <?php | ||
- | | + | var_dump(strncmp(" |
- | //outpu: int(7) | + | var_dump(strncmp(" |
+ | /** output: | ||
+ | int(7) | ||
+ | int(7) | ||
+ | */ | ||
?> | ?> | ||
</ | </ | ||
- | ===== Patchs | + | ===== BC Breaks ===== |
- | * http:// | + | * Any strncmp call with a computed length which may end up being negative will now potentially return a match where it wouldn' |
+ | ===== Patches | ||
+ | * http:// | ||
===== Tests ===== | ===== Tests ===== | ||
* http:// | * http:// | ||
+ | ===== Vote ===== | ||
+ | < | ||
+ | title=" | ||
+ | * yes | ||
+ | * no | ||
+ | </ | ||
+ | |||
===== Changelog ===== | ===== Changelog ===== | ||
* 2011-07-28 Xinchen Hui: Initial RFC creation | * 2011-07-28 Xinchen Hui: Initial RFC creation | ||
+ | * 2011-07-28 Xinchen Hui: Updated patch to avoid making binary API changed | ||
+ | * 2011-08-01 Xinchen Hui: Start voting | ||
+ | * 2011-08-08 Xinchen Hui: Edited phpt | ||
+ | * 2011-08-13 Xinchen Hui: Stop voting | ||
+ | * 2011-08-14 Xinchen Hui: Open voting again, since there comes some new objections | ||
+ | * 2011-12-13 Xinchen Hui: Won't apply now |
rfc/strncmpnegativelen.1311854175.txt.gz · Last modified: 2017/09/22 13:28 (external edit)