3v4l.org

run code in 300+ PHP versions simultaneously
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Logo to ASCII</title> <style> #logo { font-family: monospace; line-height: 0.6em; } </style> </head> <body> <?php try { $smallWidth = 100; $smallHeight = 100; $slLogo = "https://www.sololearn.com/images/fb-story-icon.jpg"; $img = imagecreatefromjpeg($slLogo); if ($img) { $width = imagesx($img); $height = imagesy($img); $smallImg = imagecreatetruecolor($smallWidth, $smallHeight); imagecopyresampled($smallImg, $img, 0, 0, 0, 0, $smallWidth, $smallHeight, $width, $height); echo "<div id='logo'>"; for ($y = 0; $y < $smallWidth; $y++) { for ($x = 0; $x < $smallHeight; $x++) { $color = imagecolorat($smallImg, $x, $y); $r = str_pad(dechex(($color >> 16) & 0xFF), 2, "0", STR_PAD_LEFT); $g = str_pad(dechex(($color >> 8) & 0xFF), 2, "0", STR_PAD_LEFT); $b = str_pad(dechex($color & 0xFF), 2, "0", STR_PAD_LEFT); echo "<i style='color:#$r$g$b'>*</i>"; } echo "<br>\n"; } echo "</div>"; imagedestroy($img); imagedestroy($smallImg); } } catch (Exception $e) { print_r($e->getMessage()); } ?> </body> </html>
Output for git.master, git.master_jit, rfc.property-hooks
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Logo to ASCII</title> <style> #logo { font-family: monospace; line-height: 0.6em; } </style> </head> <body> Fatal error: Uncaught Error: Call to undefined function imagecreatefromjpeg() in /in/mRWPE:19 Stack trace: #0 {main} thrown in /in/mRWPE on line 19
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.11 ms | 401 KiB | 8 Q