- Notifications
You must be signed in to change notification settings - Fork8k
Closed
Description
Description
The following code:
<?php$post_max_size =8 *1024 *1024;functiongenerateFile($filename,$width,$lines,$type ='binary-text') {$text ='';$t0 =microtime(TRUE);for ($i =0;$i <$lines;$i++) {// Generate $width - 1 characters to leave space for the "\n" character.for ($j =0;$j <$width -1;$j++) {switch ($type) {case'text':$text .=chr(rand(32,126));break;case'binary':$text .=chr(rand(0,31));break;case'binary-text':default:$text .=rand(0,1);break; } }$text .="\n";$t1 =microtime(TRUE);print"Iteration$i -" . (($t1 -$t0) *1000) .' ms' ."\n";$t0 =$t1; }// Create filename.$filename ='/tmp/' .$filename .'.txt';//file_put_contents($filename, $text);return$filename;}echogenerateFile('exceeding_post_max_size',ceil(($post_max_size +1024) /1024),1024);
Resulted in this output in previous versions:
...Iteration 1016 - 1.060962677002 msIteration 1017 - 1.3351440429688 msIteration 1018 - 1.4958381652832 msIteration 1019 - 1.5652179718018 msIteration 1020 - 1.133918762207 msIteration 1021 - 1.3449192047119 msIteration 1022 - 1.0910034179688 msIteration 1023 - 2.5720596313477 ms
But I'm getting this output instead:
Iteration 0 - 1.6670227050781 msIteration 1 - 3.5400390625 msIteration 2 - 5.9168338775635 msIteration 3 - 8.7440013885498 msIteration 4 - 11.125087738037 msIteration 5 - 13.100862503052 msIteration 6 - 14.358997344971 msIteration 7 - 19.643068313599 msIteration 8 - 21.284103393555 msIteration 9 - 24.443864822388 msIteration 10 - 29.021978378296 msIteration 11 - 29.219150543213 msIteration 12 - 29.844999313354 msIteration 13 - 33.437013626099 msIteration 14 - 35.980939865112 msIteration 15 - 37.060976028442 msIteration 16 - 40.301084518433 msIteration 17 - 45.086860656738 msIteration 18 - 47.156095504761 msIteration 19 - 54.861068725586 msIteration 20 - 59.279918670654 msIteration 21 - 55.058002471924 msIteration 22 - 62.628984451294 msIteration 23 - 62.710046768188 msIteration 24 - 66.666841506958 msIteration 25 - 67.9612159729 msIteration 26 - 73.35090637207 msIteration 27 - 73.814868927002 msIteration 28 - 81.268072128296 msIteration 29 - 86.863994598389 msIteration 30 - 86.045980453491 msIteration 31 - 89.563131332397 msIteration 32 - 93.811988830566 msIteration 33 - 104.84790802002 msIteration 34 - 103.92713546753 msIteration 35 - 118.44992637634 msIteration 36 - 117.29502677917 msIteration 37 - 122.51305580139 msIteration 38 - 147.05491065979 msIteration 39 - 145.72691917419 msIteration 40 - 145.61200141907 msIteration 41 - 157.13310241699 msIteration 42 - 132.14802742004 msIteration 43 - 134.90295410156 msIteration 44 - 139.23907279968 msIteration 45 - 172.71780967712 msIteration 46 - 156.75115585327 msIteration 47 - 142.99201965332 msIteration 48 - 142.3168182373 msIteration 49 - 142.22002029419 msIteration 50 - 147.85099029541 msIteration 51 - 150.74706077576 msIteration 52 - 183.83002281189 msIteration 53 - 185.53805351257 msIteration 54 - 156.80599212646 msIteration 55 - 165.35997390747 msIteration 56 - 180.59802055359 msIteration 57 - 179.68106269836 msIteration 58 - 180.39298057556 msIteration 59 - 176.19895935059 ms
PHP Version
PHP 8.3.0-alpha2
Operating System
Alpinelinux, Ubuntu