3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Naamloos document</title> </head> <body> <?php //Set the Content Type header('Content-type: image/jpeg'); // Create Image From Existing File $jpg_image = imagecreatefromjpeg('http://pookey.co.uk/gallery2/d/1166-4/Sunset.jpg'); // Allocate A Color For The Text $white = imagecolorallocate($jpg_image, 255, 255, 255); // Set Path to Font File $font_path = 'font.TTF'; // Set Text to Be Printed On Image $text = "This is a sunset!"; // Print Text On Image imagettftext($jpg_image, 25, 0, 75, 300, $white, $font_path, $text); // Send Image to Browser imagejpeg($jpg_image); // Clear Memory imagedestroy($jpg_image); ?> </body> </html>
Output for 7.0.0 - 7.1.0
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Naamloos document</title> </head> <body> Warning: Cannot modify header information - headers already sent by (output started at /in/kPMZ8:9) in /in/kPMZ8 on line 11 Fatal error: Uncaught Error: Call to undefined function imagecreatefromjpeg() in /in/kPMZ8:14 Stack trace: #0 {main} thrown in /in/kPMZ8 on line 14
Process exited with code 255.
Output for hhvm-3.12.0
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Naamloos document</title> </head> <body> Warning: Cannot modify header information - headers already sent in /in/kPMZ8 on line 11 Warning: Failed to open http://pookey.co.uk/gallery2/d/1166-4/Sunset.jpg (Could not resolve host: pookey.co.uk) in /in/kPMZ8 on line 14 Warning: failed to open stream: http://pookey.co.uk/gallery2/d/1166-4/Sunset.jpg in /in/kPMZ8 on line 14 Warning: supplied resource is not a valid Image resource in /in/kPMZ8 on line 17 Warning: supplied resource is not a valid Image resource in /in/kPMZ8 on line 26 Warning: supplied resource is not a valid Image resource in /in/kPMZ8 on line 29 </body> </html>
Output for hhvm-3.10.0
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Naamloos document</title> </head> <body> Warning: Cannot modify header information - headers already sent in /in/kPMZ8 on line 11 Warning: Failed to open http://pookey.co.uk/gallery2/d/1166-4/Sunset.jpg (Could not resolve host: pookey.co.uk) in /in/kPMZ8 on line 14 Warning: failed to open stream: http://pookey.co.uk/gallery2/d/1166-4/Sunset.jpg in /in/kPMZ8 on line 14 </body> </html>
Output for 5.2.3 - 5.6.28
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Naamloos document</title> </head> <body> Warning: Cannot modify header information - headers already sent by (output started at /in/kPMZ8:9) in /in/kPMZ8 on line 11 Fatal error: Call to undefined function imagecreatefromjpeg() in /in/kPMZ8 on line 14
Process exited with code 255.
Output for 5.0.0 - 5.2.2
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Naamloos document</title> </head> <body> Fatal error: Call to undefined function imagecreatefromjpeg() in /in/kPMZ8 on line 14
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Naamloos document</title> </head> <body> Fatal error: Call to undefined function: imagecreatefromjpeg() in /in/kPMZ8 on line 14
Process exited with code 255.
Output for 4.3.2 - 4.4.4
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Naamloos document</title> </head> <body> Fatal error: Call to undefined function: imagecreatefromjpeg() in /in/kPMZ8 on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Naamloos document</title> </head> <body> Fatal error: Call to undefined function: imagecreatefromjpeg() in /in/kPMZ8 on line 14