|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-01-09 08:23 UTC] laruence@php.net
[2018-01-09 08:23 UTC] laruence@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 00:00:01 2025 UTC |
Description: ------------ For "big" string the substr_count function returns incorrect result. Memory limit in PHP set to 30GB. Seems it works incorrect for strings>4GB. Test script: --------------- <?php $size=9*1024*1024*1024; // 9GB $buf=str_repeat(chr(0),$size); for( $i=0; $i<$size; $i++ ) if( $i%3==0 ) $buf{$i}=chr(255); $cnt=substr_count($buf,chr(255)); var_dump($cnt); ?> Expected result: ---------------- int(3221225472) Actual result: -------------- int(-1073741824)