3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //Report any errors header('content-type: image/png'); ini_set ("display_errors", "1"); error_reporting(E_ALL); //Set the correct content type //Create our basic image stream //125px width, 125px height $image = imagecreate(125, 125); //Set the background color $blue = imagecolorallocate($image, 0, 0, 255); //Set up another color just to show how the first color declared is used as the background color when we use imagecreate() //Notice how blue is applied to the background, *not* red. $red = imagecolorallocate($image, 255, 0, 0); //save the image as a png and output imagepng($image); //Clear up memory used imagedestroy($image);
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function imagecreate() in /in/XfD9k:12 Stack trace: #0 {main} thrown in /in/XfD9k on line 12
Process exited with code 255.
Output for hhvm-3.12.0
�PNG  IHDR}}�N�fPLTE�����IDATH�c`�`��Q0 F�(�M�E�iIEND�B`�
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function imagecreate() in /in/XfD9k on line 12
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: imagecreate() in /in/XfD9k on line 12
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: imagecreate() in /in/XfD9k on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: imagecreate() in /in/XfD9k on line 12