|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-10-11 17:38 UTC] mike@php.net
[2005-10-11 19:03 UTC] mike@php.net
[2005-10-13 19:05 UTC] iliaa@php.net
[2005-10-13 21:13 UTC] mike@php.net
[2005-10-14 14:02 UTC] mike@php.net
[2005-10-24 00:16 UTC] edink@php.net
[2005-10-24 00:22 UTC] edink@php.net
[2005-10-25 17:18 UTC] mike@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 03:00:02 2025 UTC |
Description: ------------ Probably an edge case, but so nobody could claim I didn't report it ;) It starts to fail with ~200k+. Reproduce code: --------------- <?php $j = 200000; $s = ''; srand(time()); for ($i = 0; $i < $j; ++$i) { $s .= chr(rand(0,255)); } gzencode($s); // fails with buffer error $r = array(); echo "\nCharcode stats:\n"; for ($i = 0; $i < $j; ++$i) { $x = ord($s{$i}); $r[$x] = isset($r[$x]) ? $r[$x]+1 : 1; } asort($r); printf("MIN: %d -- AVG: %d -- MAX: %d\n", current($r), array_sum($r)/count($r), end($r)); ?> Expected result: ---------------- No error Actual result: -------------- Warning: gzencode(): buffer error in C:\Webserver\mike\zone\gzencode.php on line 10