3v4l.org

run code in 300+ PHP versions simultaneously
<?php //---------------------------------------------------------------------------------------- // Script: // online-thumb.php // // Remark: // This sample script shows how to make a web thumbnail in the memory and // output to client browser. // // Parameters: // url: The URL of HTML page that you want to convert. the default URL is // http://www.google.com // width: The thumbnail image width. The default value is 320. // height: The thumbnail image height. The defaul value is 240. // ratiotype: The width/height ratio type. 0: keep ratio by width; 1: keep ratio by height. // The default is 0. // // Example: // <img src="online-thumb.php"> or // <img src="online-thumb.php?url=http://www.google.com"> or // <img src="online-thumb.php?url=http://www.google.com&width=320&height=240&ratiotype=0"> //---------------------------------------------------------------------------------------- // Create instance ACAWebThumb.ThumbMaker $HTML_Converter = new COM("ACAWebThumb.ThumbMaker") or die ("Create ACAWebThumb.ThumbMaker failed. Please make sure the component has been installed."); // Get the parameters $t_strURL = isset($_GET["url"]) ? $_GET["url"] : "http://www.google.com"; $t_iWidth = isset($_GET["width"]) ? $_GET["width"] : 320; $t_iHeight = isset($_GET["height"]) ? $_GET["height"] : 240; $t_iRatioType = isset($_GET["ratiotype"]) ? $_GET["ratiotype"] : 0; // Set the URL and start the snap job. $HTML_Converter->SetURL($t_strURL); if ( 0 == $HTML_Converter->StartSnap() ) { // snap successful, set the thumbnail size and get image bytes $HTML_Converter->SetThumbSize ($t_iWidth, $t_iHeight, $t_iRatioType); //get image bytes by PNG format $t_arrThumbImageBytes = $HTML_Converter->GetImageBytes ("png"); // output the image bytes to client browser if ( count($t_arrThumbImageBytes) > 0 ) { // set the output header as PNG image, then output the thumbnail image bytes. header("Content-type: image/png"); foreach($t_arrThumbImageBytes as $byte) echo chr($byte); } } ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Class "COM" not found in /in/iesNl:25 Stack trace: #0 {main} thrown in /in/iesNl on line 25
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught Error: Class 'COM' not found in /in/iesNl:25 Stack trace: #0 {main} thrown in /in/iesNl on line 25
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28
Fatal error: Class 'COM' not found in /in/iesNl on line 25
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: com in /in/iesNl on line 25
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: com in /in/iesNl on line 25

preferences:
231.22 ms | 401 KiB | 312 Q