@ 2014-11-22T10:10:12Z <?php
function make_seed() {
list($usec, $sec) = explode(' ', microtime());
return (float) $sec + ((float) $usec * 100000);
}
mt_srand(make_seed());
$size=512;
$image = imagecreatetruecolor($size,$size);
$black = imagecolorallocate ($image, 0,0,0 );
$white = imagecolorallocate ($image, 255,255,255 );
for ($x = 0; $x<$size; $x++) {
for ($y = 0; $y<$size; $y++) {
imagesetpixel($image,$x,$y,mt_rand(0,1)?$black:$white);
}
}
header ('Content-Type: image/png');
imagepng($image);
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.0.0 - 7.0.33 , 7.1.0 - 7.1.25 , 7.2.0 - 7.2.13 , 7.3.0 Fatal error: Uncaught Error: Call to undefined function imagecreatetruecolor() in /in/vdasr:8
Stack trace:
#0 {main}
thrown in /in/vdasr on line 8
Process exited with code 255 . Output for 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.38 Fatal error: Call to undefined function imagecreatetruecolor() in /in/vdasr on line 8
Process exited with code 255 . preferences:dark mode live preview ace vim emacs key bindings
69.23 ms | 408 KiB | 5 Q