3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function mostrarJPG($nombreImagen, $anchoImagen, $altoImagen) { header('Content-Type: text/html'); // Obtener los nuevos tamaños list($ancho, $alto) = getimagesize($nombreImagen); echo $alto; echo $ancho; 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); mostrarJPG("https://bbs.arkos.io/uploads/default/47/aa368ba90567d8c7.jpg", 200, 300); ?>
based on Ouc2L
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/jq3nU on line 7 Warning: getimagesize(https://bbs.arkos.io/uploads/default/47/aa368ba90567d8c7.jpg): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/jq3nU on line 7 Fatal error: Uncaught Error: Call to undefined function imagecreatetruecolor() in /in/jq3nU:19 Stack trace: #0 /in/jq3nU(32): mostrarJPG('https://bbs.ark...', 200, 300) #1 {main} thrown in /in/jq3nU on line 19
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/jq3nU on line 7 Warning: getimagesize(https://bbs.arkos.io/uploads/default/47/aa368ba90567d8c7.jpg): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/jq3nU on line 7 Fatal error: Uncaught Error: Call to undefined function imagecreatetruecolor() in /in/jq3nU:19 Stack trace: #0 /in/jq3nU(32): mostrarJPG('https://bbs.ark...', 200, 300) #1 {main} thrown in /in/jq3nU on line 19
Process exited with code 255.
Output for 5.5.24 - 5.5.32, 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/jq3nU on line 7 Warning: getimagesize(https://bbs.arkos.io/uploads/default/47/aa368ba90567d8c7.jpg): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/jq3nU on line 7 Fatal error: Call to undefined function imagecreatetruecolor() in /in/jq3nU on line 19
Process exited with code 255.
Output for 5.4.15 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19
Warning: getimagesize(): php_network_getaddresses: getaddrinfo failed: System error in /in/jq3nU on line 7 Warning: getimagesize(https://bbs.arkos.io/uploads/default/47/aa368ba90567d8c7.jpg): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/jq3nU on line 7 Fatal error: Call to undefined function imagecreatetruecolor() in /in/jq3nU on line 19
Process exited with code 255.
Output for 5.3.19 - 5.4.14
Warning: getimagesize(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/jq3nU on line 7 Warning: getimagesize(https://bbs.arkos.io/uploads/default/47/aa368ba90567d8c7.jpg): failed to open stream: No such file or directory in /in/jq3nU on line 7 Fatal error: Call to undefined function imagecreatetruecolor() in /in/jq3nU on line 19
Process exited with code 255.