3v4l.org

run code in 300+ PHP versions simultaneously
<?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 git.master, git.master_jit, rfc.property-hooks
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.

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:
42.88 ms | 401 KiB | 8 Q