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); } } ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0150.00618.55
8.3.50.0070.01321.90
8.3.40.0140.00718.97
8.3.30.0140.00319.08
8.3.20.0080.00020.20
8.3.10.0040.00421.74
8.3.00.0060.00919.13
8.2.180.0030.01318.67
8.2.170.0070.00722.96
8.2.160.0130.00320.52
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0000.00826.16
8.2.120.0040.00421.17
8.2.110.0060.00321.12
8.2.100.0080.00417.63
8.2.90.0000.00819.22
8.2.80.0000.00919.23
8.2.70.0030.00517.50
8.2.60.0050.00318.04
8.2.50.0000.00818.07
8.2.40.0090.00019.76
8.2.30.0040.00417.94
8.2.20.0000.00717.63
8.2.10.0050.00217.88
8.2.00.0000.01017.93
8.1.280.0070.01325.92
8.1.270.0060.00320.37
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00322.73
8.1.230.0070.00417.42
8.1.220.0030.00517.74
8.1.210.0030.00618.77
8.1.200.0030.00617.23
8.1.190.0040.00417.25
8.1.180.0080.00018.10
8.1.170.0000.00920.32
8.1.160.0050.00221.88
8.1.150.0000.00718.68
8.1.140.0000.00817.21
8.1.130.0040.00417.78
8.1.120.0040.00417.37
8.1.110.0050.00217.41
8.1.100.0000.00717.36
8.1.90.0030.00317.38
8.1.80.0030.00317.30
8.1.70.0040.00417.23
8.1.60.0060.00317.54
8.1.50.0000.00817.37
8.1.40.0000.00817.44
8.1.30.0060.00317.67
8.1.20.0060.00317.52
8.1.10.0040.00417.48
8.1.00.0030.00617.51
8.0.300.0040.00418.77
8.0.290.0000.00716.58
8.0.280.0030.00318.39
8.0.270.0030.00317.22
8.0.260.0030.00318.40
8.0.250.0030.00316.99
8.0.240.0000.00716.99
8.0.230.0100.00016.97
8.0.220.0000.00716.78
8.0.210.0050.00316.88
8.0.200.0060.00016.86
8.0.190.0040.00416.91
8.0.180.0040.00416.92
8.0.170.0080.00016.87
8.0.160.0040.00416.90
8.0.150.0000.00816.81
8.0.140.0000.00716.86
8.0.130.0000.00613.38
8.0.120.0000.00816.78
8.0.110.0040.00416.94
8.0.100.0070.00016.77
8.0.90.0040.00417.03
8.0.80.0130.00716.97
8.0.70.0030.00316.89
8.0.60.0070.00016.78
8.0.50.0040.00416.93
8.0.30.0020.01616.91
8.0.20.0140.00817.40
8.0.10.0040.00417.01
8.0.00.0100.00816.75
7.4.330.0000.00515.03
7.4.320.0060.00016.40
7.4.300.0000.00616.57
7.4.290.0030.00316.56
7.4.280.0070.00016.47
7.4.270.0040.00416.53
7.4.260.0000.00716.37
7.4.250.0070.00016.57
7.4.240.0040.00416.49
7.4.230.0030.00316.37
7.4.220.0130.01016.51
7.4.210.0000.01516.52
7.4.200.0040.00416.44
7.4.160.0100.00716.43
7.4.150.0110.00717.40
7.4.140.0110.01017.86
7.4.130.0050.01616.43
7.4.120.0080.00916.47
7.4.110.0100.00716.30
7.4.100.0090.01516.48
7.4.90.0130.00316.41
7.4.80.0040.01819.39
7.4.70.0060.01016.61
7.4.60.0130.00416.47
7.4.50.0040.00416.46
7.4.40.0090.01316.31
7.4.30.0100.00716.57
7.4.00.0060.01015.06
7.3.330.0000.00513.13
7.3.320.0000.00512.96
7.3.310.0000.00616.10
7.3.300.0030.00316.16
7.3.290.0100.00816.31
7.3.280.0080.00716.27
7.3.270.0080.00817.40
7.3.260.0140.00316.34
7.3.250.0130.00616.29
7.3.240.0070.01716.60
7.3.230.0120.00616.50
7.3.210.0100.00716.39
7.3.200.0120.00619.39
7.3.190.0030.01416.27
7.3.180.0090.00916.61
7.3.170.0140.00416.55
7.3.160.0120.00416.17
7.2.330.0060.01216.64
7.2.320.0090.00916.43
7.2.310.0100.01016.63
7.2.300.0100.00616.50
7.2.290.0000.01716.66
7.2.60.0080.00616.82
7.2.00.0140.00718.96
7.1.200.0060.00615.71
7.1.100.0000.00918.14
7.1.70.0000.01017.11
7.1.60.0100.00619.48
7.1.50.0100.01016.59
7.1.00.0100.07322.36
7.0.200.0000.00816.67
7.0.60.0100.08019.91
7.0.50.0130.08017.77
7.0.40.0100.08320.07
7.0.30.0370.07720.12
7.0.20.0170.04720.16
7.0.10.0330.07720.16
7.0.00.0100.03720.19
5.6.280.0100.06020.93
5.6.210.0030.04020.46
5.6.200.0100.08018.13
5.6.190.0070.03720.45
5.6.180.0230.03720.60
5.6.170.0200.06320.47
5.6.160.0030.05720.51
5.6.150.0070.08018.22
5.6.140.0070.05018.12
5.6.130.0030.05318.18
5.6.120.0070.08321.11
5.6.110.0100.05020.97
5.6.100.0130.07721.11
5.6.90.0170.06021.00
5.6.80.0030.05320.43
5.6.70.0400.09320.35
5.5.350.0130.08320.42
5.5.340.0070.05317.96
5.5.330.0070.03720.20
5.5.320.0170.04020.20
5.5.310.0100.04720.16
5.5.300.0100.06317.89
5.5.290.0100.08018.01
5.5.280.0100.08020.88
5.5.270.0100.03720.95
5.5.260.0070.07720.76
5.5.250.0030.08720.47
5.5.240.0000.08320.27
5.4.450.0270.04019.57
5.4.440.0700.06319.50
5.4.430.0830.06319.32
5.4.420.0130.05319.49
5.4.410.0000.06319.14
5.4.400.0100.05319.01
5.4.390.0170.05719.05
5.4.380.0100.05719.16
5.4.370.0130.05018.92
5.4.360.0200.04319.22
5.4.350.0070.06019.02
5.4.340.0230.06019.11
5.4.320.0070.06719.04
5.4.310.0030.05719.00
5.4.300.0070.05718.96
5.4.290.0130.05019.14
5.4.280.0000.06319.02
5.4.270.0130.05719.05
5.4.260.0170.05019.15
5.4.250.0170.06018.91
5.4.240.0100.05718.91
5.4.230.0100.05019.01
5.4.220.0170.05018.91
5.4.210.0100.05319.10
5.4.200.0070.05716.54
5.4.190.0030.05718.91
5.4.180.0130.05019.20
5.4.170.0070.06019.01
5.4.160.0230.04019.00
5.4.150.0070.06018.96
5.4.140.0070.05316.42
5.4.130.0170.04316.42
5.4.120.0030.05716.50
5.4.110.0070.05316.34
5.4.100.0030.05716.54
5.4.90.0070.05316.51
5.4.80.0100.04716.54
5.4.70.0100.05316.49
5.4.60.0070.05316.31
5.4.50.0070.05016.16
5.4.40.0070.05316.10
5.4.30.0070.05016.16
5.4.20.0130.05016.16
5.4.10.0170.04016.34
5.4.00.0170.04015.79
5.3.290.0000.06314.71
5.3.280.0100.05314.48
5.3.270.0200.04314.45
5.3.260.0100.05314.49
5.3.250.0130.04714.62
5.3.240.0170.04314.53
5.3.230.0100.05014.52
5.3.220.0100.05014.58
5.3.210.0030.05714.44
5.3.200.0070.05314.45
5.3.190.0170.04314.46
5.3.180.0100.05014.41
5.3.170.0030.05714.45
5.3.160.0100.05014.51
5.3.150.0070.05314.41
5.3.140.0030.05714.46
5.3.130.0100.05314.47
5.3.120.0100.05014.41
5.3.110.0070.05314.57
5.3.100.0070.05013.96
5.3.90.0070.05313.87
5.3.80.0100.05014.06
5.3.70.0100.05013.86
5.3.60.0070.05713.95
5.3.50.0070.06313.85
5.3.40.0130.04713.88
5.3.30.0100.04713.77
5.3.20.0030.05713.56
5.3.10.0100.04713.59
5.3.00.0070.06713.50
5.2.170.0030.04311.09
5.2.160.0070.04010.95
5.2.150.0130.03711.01
5.2.140.0030.04311.01
5.2.130.0130.03711.17
5.2.120.0000.05311.06
5.2.110.0170.04011.03
5.2.100.0100.03710.96
5.2.90.0130.04311.21
5.2.80.0030.04711.16
5.2.70.0030.04710.90
5.2.60.0030.04711.00
5.2.50.0000.05010.95
5.2.40.0100.04010.93
5.2.30.0030.04310.88
5.2.20.0030.04310.75
5.2.10.0000.04710.94
5.2.00.0030.04310.67
5.1.60.0170.0239.93
5.1.50.0170.0409.85
5.1.40.0070.03310.07
5.1.30.0000.04310.37
5.1.20.0070.03710.27
5.1.10.0100.03010.00
5.1.00.0170.0339.94
5.0.50.0030.0308.47
5.0.40.0030.0308.34
5.0.30.0030.0438.18
5.0.20.0000.0308.34
5.0.10.0070.0378.22
5.0.00.0100.0378.28
4.4.90.0030.0235.84
4.4.80.0070.0205.79
4.4.70.0100.0175.75
4.4.60.0000.0235.86
4.4.50.0030.0235.79
4.4.40.0000.0375.79
4.4.30.0130.0135.77
4.4.20.0100.0135.81
4.4.10.0070.0205.97
4.4.00.0030.0375.89
4.3.110.0000.0275.81
4.3.100.0000.0235.75
4.3.90.0030.0235.82
4.3.80.0030.0335.76
4.3.70.0030.0205.75
4.3.60.0030.0275.68
4.3.50.0070.0205.79
4.3.40.0030.0335.62
4.3.30.0000.0274.44
4.3.20.0030.0204.54
4.3.10.0030.0204.40
4.3.00.0000.01315.68

preferences:
63.01 ms | 401 KiB | 5 Q