3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $code = rand(1000,9999); $_SESSION["code"] = $code; $im = imagecreatetruecolor(50, 30); imagesavealpha($im, true); $bg = imagecolorallocatealpha($im, 0, 0, 0, 127); //background color blue $fg = imagecolorallocate($im, 0, 0, 0);//text color white imagefill($im, 0, 0, $bg); imagestring($im, 8, 8, 8, $code, $fg); header("Cache-Control: no-cache, must-revalidate"); header('Content-type: image/png'); imagepng($im); imagedestroy($im); ?>
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function imagecreatetruecolor() in /in/5a6WJ:4 Stack trace: #0 {main} thrown in /in/5a6WJ on line 4
Process exited with code 255.
Output for hhvm-3.12.0
Warning: Unsupported font: 8 in /in/5a6WJ on line 9 �PNG  IHDR2nQM��IDATX��� C��O&8�l�}'ŭ[0�c�� ���3����2�1�P��ƲU `�> d eb31&Ӥ5B-� Y�3��9ӘfЍTEz3�~�e��VF�09}�rB��&7��� d����6i���CCjn���B4�c ���-h`�IEND�B`�
Output for hhvm-3.10.0
Warning: Unsupported font: 8 in /in/5a6WJ on line 9 �PNG  IHDR2nQM��IDATX��A� ��_�WR-�b����-H3!�B����c�;Ƌs@�e<��� 4ɆȂ؅����/7˷�'�#q��&�]��6��:��B_ ��vd�L��]<� ����e'�Ӭ�c��U"�~! !�����A�P��TIEND�B`�
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function imagecreatetruecolor() in /in/5a6WJ on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: imagecreatetruecolor() in /in/5a6WJ on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: imagecreatetruecolor() in /in/5a6WJ on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: imagecreatetruecolor() in /in/5a6WJ on line 4