3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $sampleImage = imagecreatefrompng("http://www.w3resource-practice.com/php/sample-image.png"); $black = imagecolorallocate( $sampleImage, 0, 0, 0 ); $width = imagesx($sampleImage); $height = imagesy($sampleImage); imagerectangle( $sampleImage, 0, 0, $width-1, $height-1, $black ); header( "Content-type: image/png"); imagepng($sampleImage); imagedestroy($sampleImage);
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function imagecreatefrompng() in /in/GuR3h:2 Stack trace: #0 {main} thrown in /in/GuR3h on line 2
Process exited with code 255.
Output for hhvm-3.12.0
Warning: Failed to open http://www.w3resource-practice.com/php/sample-image.png (Could not resolve host: www.w3resource-practice.com) in /in/GuR3h on line 2 Warning: failed to open stream: http://www.w3resource-practice.com/php/sample-image.png in /in/GuR3h on line 2 Warning: supplied resource is not a valid Image resource in /in/GuR3h on line 3 Warning: supplied resource is not a valid Image resource in /in/GuR3h on line 4 Warning: supplied resource is not a valid Image resource in /in/GuR3h on line 5 Warning: supplied resource is not a valid Image resource in /in/GuR3h on line 6 Warning: supplied resource is not a valid Image resource in /in/GuR3h on line 8
Output for hhvm-3.10.0
Warning: Failed to open http://www.w3resource-practice.com/php/sample-image.png (Could not resolve host: www.w3resource-practice.com) in /in/GuR3h on line 2 Warning: failed to open stream: http://www.w3resource-practice.com/php/sample-image.png in /in/GuR3h on line 2
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function imagecreatefrompng() in /in/GuR3h on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: imagecreatefrompng() in /in/GuR3h on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: imagecreatefrompng() in /in/GuR3h on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: imagecreatefrompng() in /in/GuR3h on line 2