3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $numberOfImages = 3; $x = 940; $y = 420; $background = imagecreatetruecolor($x, $y*3); $firstUrl = '/images/upload/photoalbum/photo/1.jpg'; $secondUrl = '/images/upload/photoalbum/photo/2.jpg'; $thirdUrl = '/images/upload/photoalbum/photo/3.jpg'; $outputImage = $background; $first = imagecreatefromjpeg($firstUrl); $second = imagecreatefromjpeg($secondUrl); $third = imagecreatefromjpeg($thirdUrl); imagecopymerge($outputImage,$first,0,0,0,0, $x, $y,100); imagecopymerge($outputImage,$second,0,$y,0,0, $x, $y,100); imagecopymerge($outputImage,$third,0,$y*2,0,0, $x, $y,100); imagejpeg($outputImage, APPLICATION_PATH .'/images/upload/photoalbum/photo/test.jpg'); imagedestroy($outputImage); ?>
Output for 7.0.0 - 7.1.10
Fatal error: Uncaught Error: Call to undefined function imagecreatetruecolor() in /in/ejvrv:5 Stack trace: #0 {main} thrown in /in/ejvrv on line 5
Process exited with code 255.
Output for hhvm-3.22.0
Warning: No such file or directory in /in/ejvrv on line -1 Warning: failed to open stream: /images/upload/photoalbum/photo/1.jpg in /in/ejvrv on line -1 Warning: No such file or directory in /in/ejvrv on line -1 Warning: failed to open stream: /images/upload/photoalbum/photo/2.jpg in /in/ejvrv on line -1 Warning: No such file or directory in /in/ejvrv on line -1 Warning: failed to open stream: /images/upload/photoalbum/photo/3.jpg in /in/ejvrv on line -1 Warning: imagecopymerge() expects parameter 2 to be resource, boolean given in /in/ejvrv on line -1 Warning: imagecopymerge() expects parameter 2 to be resource, boolean given in /in/ejvrv on line -1 Warning: imagecopymerge() expects parameter 2 to be resource, boolean given in /in/ejvrv on line -1 Notice: Use of undefined constant APPLICATION_PATH - assumed 'APPLICATION_PATH' in /in/ejvrv on line -1 Warning: No such file or directory in /in/ejvrv on line -1 Warning: Unable to open 'APPLICATION_PATH/images/upload/photoalbum/photo/test.jpg' for writing in /in/ejvrv on line -1
Output for hhvm-3.18.5 - 3.21.3
Warning: No such file or directory in /in/ejvrv on line 16 Warning: failed to open stream: /images/upload/photoalbum/photo/1.jpg in /in/ejvrv on line 16 Warning: No such file or directory in /in/ejvrv on line 17 Warning: failed to open stream: /images/upload/photoalbum/photo/2.jpg in /in/ejvrv on line 17 Warning: No such file or directory in /in/ejvrv on line 18 Warning: failed to open stream: /images/upload/photoalbum/photo/3.jpg in /in/ejvrv on line 18 Warning: imagecopymerge() expects parameter 2 to be resource, boolean given in /in/ejvrv on line 22 Warning: imagecopymerge() expects parameter 2 to be resource, boolean given in /in/ejvrv on line 23 Warning: imagecopymerge() expects parameter 2 to be resource, boolean given in /in/ejvrv on line 24 Notice: Use of undefined constant APPLICATION_PATH - assumed 'APPLICATION_PATH' in /in/ejvrv on line 26 Warning: No such file or directory in /in/ejvrv on line 26 Warning: Unable to open 'APPLICATION_PATH/images/upload/photoalbum/photo/test.jpg' for writing in /in/ejvrv on line 26
Output for 5.6.0 - 5.6.30
Fatal error: Call to undefined function imagecreatetruecolor() in /in/ejvrv on line 5
Process exited with code 255.