|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-05-19 20:35 UTC] lunter at interia dot pl
[2006-05-19 20:37 UTC] pajoye@php.net
[2006-05-19 20:49 UTC] lunter at interia dot pl
[2006-05-19 20:54 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 08:00:01 2025 UTC |
Description: ------------ rand() weakness. example (reproduce code): rand generate pattern instead of noise Reproduce code: --------------- <? $i=imagecreatetruecolor(1024,768); for($y=0;$y<768;$y++){ for($x=0;$x<1024;$x++){ $c=rand(0,1)*255; imagesetpixel($i,$x,$y,($c<<16)+($c<<8)+$c); } } header('Content-type: image/png'); imagepng($i); ?> Expected result: ---------------- noise Actual result: -------------- pattern