3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php <?php // thumb width $square = 150; $large = 200; $small = 100; ////////////////////////////////////////////////////////////////////////////////// square if( isset($_GET["img"]) && ( $_GET["type"] == "square" || $_GET["type"] == "" ) ){ // thumb size $thumb_width = $square; $thumb_height = $square; // align $align = $_GET["align"]; // image source $imgSrc = $_GET["img"]; $imgExt = substr($imgSrc,-3); // image extension if($imgExt == "jpg"){ $myImage = imagecreatefromjpeg($imgSrc); } if($imgExt == "gif"){ $myImage = imagecreatefromgif($imgSrc); } if($imgExt == "png"){ $myImage = imagecreatefrompng($imgSrc); } // getting the image dimensions list($width_orig, $height_orig) = getimagesize($imgSrc); // ratio $ratio_orig = $width_orig/$height_orig; // landscape or portrait? if ($thumb_width/$thumb_height > $ratio_orig) { $new_height = $thumb_width/$ratio_orig; $new_width = $thumb_width; } else { $new_width = $thumb_height*$ratio_orig; $new_height = $thumb_height; } } // middle
Output for 7.0.0 - 7.0.1
Parse error: syntax error, unexpected '<', expecting end of file in /in/tvJ7i on line 3
Process exited with code 255.
Output for 5.3.21 - 5.6.16
Parse error: syntax error, unexpected '<' in /in/tvJ7i on line 3
Process exited with code 255.