3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); /** * generates a image with chars instead of pixels * * @param string $url Filepath or url * @param string $chars The chars which should replace the pixels * @param int $shrpns Sharpness (2 = every second pixel, 1 = every pixel ... ) * @param int $size * @param int $weight font-weight/size * @return sesource * @author Nicolas 'KeksNicoh' Heimann <www.salamipla.net> * @date 02nov08 */ function pixelfuck($url, $chars='ewk34543§G§$§$Tg34g4g', $shrpns=1, $size=4,$weight=2) { list($w, $h, $type) = getimagesize($url); $resource = imagecreatefromstring(file_get_contents($url)); $img = imagecreatetruecolor($w*$size,$h*$size); $cc = strlen($chars); for($y=0;$y <$h;$y+=$shrpns) for($x=0;$x <$w;$x+=$shrpns) imagestring($img,$weight,$x*$size,$y*$size, $chars{@++$p%$cc}, imagecolorat($resource, $x, $y)); return $img; } $url = 'http://upload.wikimedia.org/wikipedia/commons/b/be/Manga_Icon.png'; $text = 'I-dont-like-manga-...-Why-do-they-have-such-big-eyes? Strange-...-WHAT-WANT-YOU-DO?'; Header('Content-Type: image/png'); imagepng(pixelfuck($url, $text, 1, 6)); ?>
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function imagepng() in /in/Rl48e:32 Stack trace: #0 {main} thrown in /in/Rl48e on line 32
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function imagepng() in /in/Rl48e on line 32
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: imagepng() in /in/Rl48e on line 32
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: imagepng() in /in/Rl48e on line 32
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: imagepng() in /in/Rl48e on line 32