Mantis - Quercus
|
Viewing Issue Advanced Details |
|
ID:
|
Category:
|
Severity:
|
Reproducibility:
|
Date Submitted:
|
Last Update:
|
4494 |
|
major |
always |
04-11-11 23:31 |
07-27-18 04:09 |
|
Reporter:
|
lionel_hutz12 |
Platform:
|
Apache Tomcat 6.0.29 Server |
|
Assigned To:
|
|
OS:
|
Windows |
|
Priority:
|
normal |
OS Version:
|
7 |
|
Status:
|
new |
Product Version:
|
3.2.1 |
|
Product Build:
|
|
Resolution:
|
open |
|
Projection:
|
none |
|
|
|
ETA:
|
none |
Fixed in Version:
|
|
|
|
Summary:
|
0004494: substr_count does not provide an accurate count when the search string is repeated in succession |
Description:
|
substr_count skips the second instance of the search character(s) when they appear in succession in the searched string. For example, if you are searching for the number of times the character 'a' is present in the searched string and the search string contains "aa" it will only report 1 instance, instead of 2 times. |
Steps To Reproduce:
|
$diff_string = "aaaaa";
echo "Should produce 5, but only shows (3): " . substr_count($diff_string, "a");
|
Additional Information:
|
Work around for this issue, may be to use:
preg_match_all('/a/', "aaaaa", $chunks);
which accurately prints out 5 |
Relationships | |
Attached Files:
|
|