3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Image { public $height; public $width; public $htmlAttribute; } $filename = "http://img.wikinut.com/img/gycf69_-6rv_5fol/jpeg/0/Best-Friends-Img-Src%3AImage%3A-FreeDigitalPhotos.net.jpeg"; $imgSize = getimagesize($filename) or die('Sorry, File Not Found'); if ($imgSize != "") { $img = new Image(); $img->height = $imgSize[0]; $img->width = $imgSize[1]; $img->htmlAttribute = $imgSize[3]; $counter = 0; foreach ($imgSize as $imgProp) { echo $counter.":".PHP_EOL.$imgProp .PHP_EOL; $counter += 1; } echo '<img src="'.$filename.'" />'; }
Output for 5.2.6 - 7.1.0
Warning: getimagesize(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/Y0KWe on line 13 Warning: getimagesize(http://img.wikinut.com/img/gycf69_-6rv_5fol/jpeg/0/Best-Friends-Img-Src%3AImage%3A-FreeDigitalPhotos.net.jpeg): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/Y0KWe on line 13 Sorry, File Not Found
Output for 5.0.3 - 5.2.5
Warning: getimagesize(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/Y0KWe on line 13 Warning: getimagesize(http://img.wikinut.com/img/gycf69_-6rv_5fol/jpeg/0/Best-Friends-Img-Src%3AImage%3A-FreeDigitalPhotos.net.jpeg): failed to open stream: Connection refused in /in/Y0KWe on line 13 Sorry, File Not Found
Output for 5.0.1 - 5.0.2
Warning: getimagesize(): php_network_getaddresses: gethostbyname failed in /in/Y0KWe on line 13 Warning: getimagesize(http://img.wikinut.com/img/gycf69_-6rv_5fol/jpeg/0/Best-Friends-Img-Src%3AImage%3A-FreeDigitalPhotos.net.jpeg): failed to open stream: Success in /in/Y0KWe on line 13 Sorry, File Not Found
Output for 5.0.0
Warning: getimagesize(): php_network_getaddresses: gethostbyname failed in /in/Y0KWe on line 13 Warning: getimagesize(http://img.wikinut.com/img/gycf69_-6rv_5fol/jpeg/0/Best-Friends-Img-Src%3AImage%3A-FreeDigitalPhotos.net.jpeg): failed to open stream: Bad file descriptor in /in/Y0KWe on line 13 Sorry, File Not Found
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/Y0KWe on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/Y0KWe on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/Y0KWe on line 5
Process exited with code 255.