3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /in/Rl48e on line 24
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/Rl48e on line 24 Warning: Cannot modify header information - headers already sent by (output started at /in/Rl48e:24) in /in/Rl48e on line 31 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 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
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.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
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.3.11, 4.4.0 - 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

preferences:
321.01 ms | 401 KiB | 459 Q