3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $font_size = 30; $image_width = 100; $image_height = 40; $image = imagecreate($image_width, $image_height); imagecolorallocate($image, 226, 226, 226); $font_color = imagecolorallocate($image, 255, 0, 0); $line_color = imagecolorallocate($image, 0, 0, 0); for ($i=0; $i <40 ; $i++) { $x1 = rand(1, 100); $y1 = rand(1, 100); $x2 = rand(1, 100); $y2 = rand(1, 100); imageline($image, $x1, $y1, $x2, $y2, $line_color); } imagettftext($image, $font_size, 0, 10, 30, $font_color, 'font/captcha_font.ttf', $text); // imagestring($image, 4, 20, 10, $text, $font_color); imagejpeg($image);
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function imagecreate() in /in/Y0WQg:6 Stack trace: #0 {main} thrown in /in/Y0WQg on line 6
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function imagecreate() in /in/Y0WQg on line 6
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: imagecreate() in /in/Y0WQg on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: imagecreate() in /in/Y0WQg on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: imagecreate() in /in/Y0WQg on line 6