3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function "open_image" ($file) { // Get extension $extension = strrchr($file, '.'); $extension = strtolower($extension); switch($extension) { case '.jpg': $im = $file; break; case '.jpeg': $im = @imagecreatefromjpeg($file); break; case '.gif': $im = @imagecreatefromgif($file); break; case '.tiff': $im = @imagecreatefromtiff($file); break; // ... etc default: $im = false; break; } return $im; } ?>
Output for 5.4.0 - 5.4.22
Parse error: syntax error, unexpected '"open_image"' (T_CONSTANT_ENCAPSED_STRING), expecting identifier (T_STRING) or '(' in /in/EqVMh on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_STRING or '(' in /in/EqVMh on line 3
Process exited with code 255.