3v4l.org

run code in 300+ PHP versions simultaneously
<? // Set the save folder // [IMPORTANT NOTE]: // This sample saves the snapshot to the folder on the work dir of this script. // Please make sure the script has the WRITE permission in this folder. // You can also set the value to other folder, for example: // $t_strSaveFolder = "c:/temp"; $t_strSaveFolder = dirname(__FILE__); // Set the image filename $t_strLargeImage = $t_strSaveFolder."/main-thumb.large.png"; $t_strSmallImage = $t_strSaveFolder."/main-thumb.small.png"; // Create instance ACAWebThumb.ThumbMaker. $t_xMaker = new COM("ACAWebThumb.ThumbMaker") or die("Start ACAWebThumb.Maker failed"); // Set the URL and start snap $t_strURL = 'http://www.acasystems.com'; $t_xMaker->SetURL($t_strURL); $t_iRet = $t_xMaker->StartSnap(); if ( 0 == $t_iRet ) { // snap successful, save webpage to image with full size. $t_bRet1 = $t_xMaker->SaveImage($t_strLargeImage); // save webpage to thumbnail with 320x240 size $t_xMaker->SetThumbSize (320, 240, 0); $t_bRet2 = $t_xMaker->SaveImage($t_strSmallImage); // show the image online. if ( $t_bRet1 && $t_bRet2) { echo "The snapshot from <a href='".$t_strURL."' target=_blank>".$t_strURL."</a>:"; echo "<a href='main-thumb.large.png'>img src='main-thumb.small.png' border=1></a>"; } else { echo "ERROR: Can't save the snapshot to folder ".dirname(__FILE__).". "; echo "Please make sure the script has the WRITE PERMISSION in this folder."; } } else echo "ERROR: Snap from ".$t_strURL." failed. "; ?>
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 7.1.25 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
<? // Set the save folder // [IMPORTANT NOTE]: // This sample saves the snapshot to the folder on the work dir of this script. // Please make sure the script has the WRITE permission in this folder. // You can also set the value to other folder, for example: // $t_strSaveFolder = "c:/temp"; $t_strSaveFolder = dirname(__FILE__); // Set the image filename $t_strLargeImage = $t_strSaveFolder."/main-thumb.large.png"; $t_strSmallImage = $t_strSaveFolder."/main-thumb.small.png"; // Create instance ACAWebThumb.ThumbMaker. $t_xMaker = new COM("ACAWebThumb.ThumbMaker") or die("Start ACAWebThumb.Maker failed"); // Set the URL and start snap $t_strURL = 'http://www.acasystems.com'; $t_xMaker->SetURL($t_strURL); $t_iRet = $t_xMaker->StartSnap(); if ( 0 == $t_iRet ) { // snap successful, save webpage to image with full size. $t_bRet1 = $t_xMaker->SaveImage($t_strLargeImage); // save webpage to thumbnail with 320x240 size $t_xMaker->SetThumbSize (320, 240, 0); $t_bRet2 = $t_xMaker->SaveImage($t_strSmallImage); // show the image online. if ( $t_bRet1 && $t_bRet2) { echo "The snapshot from <a href='".$t_strURL."' target=_blank>".$t_strURL."</a>:"; echo "<a href='main-thumb.large.png'>img src='main-thumb.small.png' border=1></a>"; } else { echo "ERROR: Can't save the snapshot to folder ".dirname(__FILE__).". "; echo "Please make sure the script has the WRITE PERMISSION in this folder."; } } else echo "ERROR: Snap from ".$t_strURL." failed. "; ?>
Output for 8.0.13
Fatal error: Uncaught Error: Class "COM" not found in /in/1hjrr:15 Stack trace: #0 {main} thrown in /in/1hjrr on line 15
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.3.32 - 7.3.33, 7.4.33
Fatal error: Uncaught Error: Class 'COM' not found in /in/1hjrr:15 Stack trace: #0 {main} thrown in /in/1hjrr on line 15
Process exited with code 255.
Output for 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/1hjrr on line 15
Process exited with code 255.

preferences:
294.47 ms | 402 KiB | 353 Q