3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function getext($filename) { $pos = strrpos($filename,'.'); $str = substr($filename, $pos); return $str; } $image = 'http://webplatformtools.org/images/app/logo.png'; $ext = getext($image); if($ext == ".jpg"){ $img = ImageCreateFromJpeg($image); } else{ echo'Wrong File Type'; } $width = imagesx($img); $height = imagesy($img); for($h=0;$h<$height;$h++){ for($w=0;$w<=$width;$w++){ $rgb = ImageColorAt($img, $w, $h); $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; if($w == $width){ echo '<br>'; }else{ echo '<span style="color:rgb('.$r.','.$g.','.$b.');">#</span>'; } } } ?>
Output for 7.0.0 - 7.2.6
Wrong File Type Fatal error: Uncaught Error: Call to undefined function imagesx() in /in/Fgt2l:15 Stack trace: #0 {main} thrown in /in/Fgt2l on line 15
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Wrong File Type Fatal error: Call to undefined function imagesx() in /in/Fgt2l on line 15
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Wrong File Type Fatal error: Call to undefined function: imagesx() in /in/Fgt2l on line 15
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Wrong File Type Fatal error: Call to undefined function: imagesx() in /in/Fgt2l on line 15
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Wrong File Type Fatal error: Call to undefined function: imagesx() in /in/Fgt2l on line 15