3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php session_start(); $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/H3GqV:5 Stack trace: #0 {main} thrown in /in/H3GqV on line 5
Process exited with code 255.
Output for 5.2.3 - 5.6.28
Fatal error: Call to undefined function imagecreatetruecolor() in /in/H3GqV on line 5
Process exited with code 255.
Output for 5.0.0 - 5.2.2
<br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/in/H3GqV</b> on line <b>2</b><br /> <br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /in/H3GqV:2) in <b>/in/H3GqV</b> on line <b>2</b><br /> <br /> <b>Fatal error</b>: Call to undefined function imagecreatetruecolor() in <b>/in/H3GqV</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/in/H3GqV</b> on line <b>2</b><br /> <br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /in/H3GqV:2) in <b>/in/H3GqV</b> on line <b>2</b><br /> <br /> <b>Fatal error</b>: Call to undefined function: imagecreatetruecolor() in <b>/in/H3GqV</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.4.3 - 4.4.4
<br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/in/H3GqV</b> on line <b>2</b><br /> <br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /in/H3GqV:2) in <b>/in/H3GqV</b> on line <b>2</b><br /> <br /> <b>Fatal error</b>: Call to undefined function: imagecreatetruecolor() in <b>/in/H3GqV</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.2
<br /> <b>Warning</b>: session_start(): Cannot send session cookie - headers already sent in <b>/in/H3GqV</b> on line <b>2</b><br /> <br /> <b>Warning</b>: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/H3GqV:2) in <b>/in/H3GqV</b> on line <b>2</b><br /> <br /> <b>Fatal error</b>: Call to undefined function: imagecreatetruecolor() in <b>/in/H3GqV</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Warning</b>: session_start() [<a href='http://www.php.net/function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/in/H3GqV</b> on line <b>2</b><br /> <br /> <b>Warning</b>: session_start() [<a href='http://www.php.net/function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /in/H3GqV:2) in <b>/in/H3GqV</b> on line <b>2</b><br /> <br /> <b>Fatal error</b>: Call to undefined function: imagecreatetruecolor() in <b>/in/H3GqV</b> on line <b>5</b><br />