3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function mostrarJPG($nombreImagen, $anchoImagen, $altoImagen) { header('Content-Type: image/jpeg'); // Obtener los nuevos tamaños list($ancho, $alto) = getimagesize($nombreImagen); if($anchoImagen == 0) { $anchoImagen = $ancho; } if($altoImagen == 0) { $altoImagen = $alto; } // Cargar $thumb = imagecreatetruecolor($anchoImagen, $altoImagen); imagealphablending( $thumb, false ); imagesavealpha( $thumb, true ); $origen = imagecreatefromjpeg($nombreImagen); // Cambiar el tamaño imagecopyresized($thumb, $origen, 0, 0, 0, 0, $anchoImagen, $altoImagen, $ancho, $alto); // Imprimir imagejpeg($thumb); } mostrarJPG("http://365.clarin.com/wp-content/uploads/2014/11/100_Chungo.jpg", 200, 300); ?>
based on hGSkF
Output for 7.0.4, 7.0.20, 7.1.5 - 7.2.0
Warning: getimagesize(): php_network_getaddresses: getaddrinfo failed: System error in /in/PJTJn on line 7 Warning: getimagesize(http://365.clarin.com/wp-content/uploads/2014/11/100_Chungo.jpg): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/PJTJn on line 7 Fatal error: Uncaught Error: Call to undefined function imagecreatetruecolor() in /in/PJTJn:16 Stack trace: #0 /in/PJTJn(28): mostrarJPG('http://365.clar...', 200, 300) #1 {main} thrown in /in/PJTJn on line 16
Process exited with code 255.
Output for 7.0.0 - 7.0.3, 7.0.5 - 7.0.6, 7.1.0
Warning: getimagesize(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/PJTJn on line 7 Warning: getimagesize(http://365.clarin.com/wp-content/uploads/2014/11/100_Chungo.jpg): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/PJTJn on line 7 Fatal error: Uncaught Error: Call to undefined function imagecreatetruecolor() in /in/PJTJn:16 Stack trace: #0 /in/PJTJn(28): mostrarJPG('http://365.clar...', 200, 300) #1 {main} thrown in /in/PJTJn on line 16
Process exited with code 255.
Output for 5.5.24 - 5.5.31, 5.5.34 - 5.6.17, 5.6.20 - 5.6.28
Warning: getimagesize(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/PJTJn on line 7 Warning: getimagesize(http://365.clarin.com/wp-content/uploads/2014/11/100_Chungo.jpg): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/PJTJn on line 7 Fatal error: Call to undefined function imagecreatetruecolor() in /in/PJTJn on line 16
Process exited with code 255.
Output for 5.3.19 - 5.4.45, 5.5.32 - 5.5.33, 5.6.18 - 5.6.19
Warning: getimagesize(): php_network_getaddresses: getaddrinfo failed: System error in /in/PJTJn on line 7 Warning: getimagesize(http://365.clarin.com/wp-content/uploads/2014/11/100_Chungo.jpg): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/PJTJn on line 7 Fatal error: Call to undefined function imagecreatetruecolor() in /in/PJTJn on line 16
Process exited with code 255.