3v4l.org

run code in 300+ PHP versions simultaneously
<?php function resizeImg($img, $width, $height, $path) { $i = new Imagick($img); $i->scaleImage($width, $height); $gig = $i->getImageGeometry(); if(($gig['width']/$width) < ($gig['height']/$height)) { $i->cropImage($gig['width'], floor($height * $gig['width'] / $width), 0, (($gig['height'] - ($height * $gig['width'] / $width)) / 2)); } else { $i->cropImage(ceil($width * $gig['height'] / $height), $gig['height'], (($gig['width'] - ($width * $gig['height'] / $height)) / 2), 0); } $i->ThumbnailImage($width, $height,true); $i->setImageFormat("jpeg"); $i->setImageCompressionQuality(90); $i->writeImage($path); return $i->getimage(); }

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.0090.01218.55
8.3.50.0110.00416.36
8.3.40.0110.00618.57
8.3.30.0060.00920.18
8.3.20.0080.00020.34
8.3.10.0090.00022.02
8.3.00.0040.00422.38
8.2.180.0110.00416.47
8.2.170.0100.00722.96
8.2.160.0070.00720.35
8.2.150.0000.00824.18
8.2.140.0190.00024.66
8.2.130.0140.00026.16
8.2.120.0040.00419.79
8.2.110.0090.00022.31
8.2.100.0090.00319.47
8.2.90.0040.00419.16
8.2.80.0000.00719.25
8.2.70.0040.00417.38
8.2.60.0000.00817.91
8.2.50.0030.00618.07
8.2.40.0030.00518.03
8.2.30.0040.00418.07
8.2.20.0040.00417.42
8.2.10.0000.00817.45
8.2.00.0040.00417.48
8.1.270.0090.00020.10
8.1.260.0040.00426.35
8.1.250.0000.00928.09
8.1.240.0040.00423.98
8.1.230.0070.00418.87
8.1.220.0030.00517.74
8.1.210.0060.00318.77
8.1.200.0060.00317.22
8.1.190.0000.00817.28
8.1.180.0040.00418.82
8.1.170.0000.00818.66
8.1.160.0030.00322.16
8.1.150.0050.00318.53
8.1.140.0020.00517.34
8.1.130.0040.00417.70
8.1.120.0070.00017.27
8.1.110.0030.00317.39
8.1.100.0000.00817.38
8.1.90.0070.00017.41
8.1.80.0060.00317.39
8.1.70.0030.00317.34
8.1.60.0050.00317.44
8.1.50.0060.00317.42
8.1.40.0040.00417.36
8.1.30.0040.00417.42
8.1.20.0000.00817.55
8.1.10.0000.00817.42
8.1.00.0030.00617.38
8.0.300.0000.00718.77
8.0.290.0040.00417.05
8.0.280.0050.00318.25
8.0.270.0030.00317.22
8.0.260.0070.00016.71
8.0.250.0000.00716.84
8.0.240.0000.00816.84
8.0.230.0040.00416.85
8.0.220.0050.00216.69
8.0.210.0040.00416.82
8.0.200.0040.00416.89
8.0.190.0000.00816.82
8.0.180.0050.00516.82
8.0.170.0000.00916.82
8.0.160.0000.00816.73
8.0.150.0030.00516.71
8.0.140.0060.00316.70
8.0.130.0000.00513.17
8.0.120.0030.00516.67
8.0.110.0020.00516.71
8.0.100.0050.00316.58
8.0.90.0050.00316.69
8.0.80.0100.01016.81
8.0.70.0000.00716.65
8.0.60.0040.00416.82
8.0.50.0040.00416.73
8.0.30.0100.00816.90
8.0.20.0090.00917.40
8.0.10.0000.00716.96
8.0.00.0120.01016.66
7.4.330.0000.00515.00
7.4.320.0030.00316.49
7.4.300.0030.00316.43
7.4.290.0030.00316.36
7.4.280.0000.00716.35
7.4.270.0030.00316.52
7.4.260.0000.00816.48
7.4.250.0070.00016.43
7.4.240.0030.00416.40
7.4.230.0030.00316.29
7.4.220.0140.00316.45
7.4.210.0080.00616.41
7.4.200.0000.00816.61
7.4.190.0000.00816.63
7.4.160.0080.00816.13
7.4.150.0140.00417.40
7.4.140.0090.01217.86
7.4.130.0100.00816.61
7.4.120.0040.01316.46
7.4.110.0150.00316.34
7.4.100.0090.00916.38
7.4.90.0090.00916.29
7.4.80.0110.01119.39
7.4.70.0060.01116.38
7.4.60.0120.00916.34
7.4.50.0050.00316.28
7.4.40.0090.00322.77
7.4.30.0080.01116.32
7.4.10.0040.01414.94
7.4.00.0080.00914.89
7.3.330.0000.00512.98
7.3.320.0060.00013.15
7.3.310.0070.00016.18
7.3.300.0000.00716.20
7.3.290.0070.00716.19
7.3.280.0100.00516.20
7.3.270.0030.01317.40
7.3.260.0100.01016.32
7.3.250.0070.01016.27
7.3.240.0060.00916.27
7.3.230.0100.01316.39
7.3.210.0140.00416.13
7.3.200.0120.00319.39
7.3.190.0100.00916.39
7.3.180.0140.00716.26
7.3.170.0100.00716.39
7.3.160.0130.00316.30
7.3.130.0060.00914.49
7.3.120.0090.00714.71
7.3.110.0040.01414.89
7.3.100.0090.00614.68
7.3.90.0070.00914.57
7.3.80.0060.00614.56
7.3.70.0100.00614.54
7.3.60.0060.00814.74
7.3.50.0050.00714.47
7.3.40.0100.00514.75
7.3.30.0030.00814.53
7.3.20.0030.01016.66
7.3.10.0060.00616.34
7.3.00.0030.01116.45
7.2.330.0100.00716.45
7.2.320.0120.00916.51
7.2.310.0140.00316.54
7.2.300.0110.00616.27
7.2.290.0100.01016.60
7.2.260.0070.00714.51
7.2.250.0070.00914.72
7.2.240.0050.01214.91
7.2.230.0080.00614.79
7.2.220.0070.01014.66
7.2.210.0070.00914.63
7.2.200.0030.01214.65
7.2.190.0060.00914.87
7.2.180.0050.00614.91
7.2.170.0040.00714.89
7.2.160.0090.00614.96
7.2.150.0040.01116.62
7.2.140.0050.00816.66
7.2.130.0070.00816.62
7.2.120.0090.00716.61
7.2.110.0050.00916.61
7.2.100.0070.00616.58
7.2.90.0070.00716.69
7.2.80.0060.00816.60
7.2.70.0050.00616.76
7.2.60.0050.00816.63
7.2.50.0050.00816.63
7.2.40.0050.00916.65
7.2.30.0020.01216.71
7.2.20.0070.00816.63
7.2.10.0080.00916.70
7.2.00.0080.00617.11
7.1.330.0090.00915.47
7.1.320.0050.00615.61
7.1.310.0070.00615.54
7.1.300.0050.00915.52
7.1.290.0050.00815.52
7.1.280.0070.00815.49
7.1.270.0030.00915.54
7.1.260.0060.00615.50
7.1.250.0040.01115.47
7.1.240.0060.00815.63
7.1.230.0080.00615.45
7.1.220.0040.00915.55
7.1.210.0050.00715.61
7.1.200.0050.00715.54
7.1.190.0040.01015.49
7.1.180.0100.00515.58
7.1.170.0060.00815.73
7.1.160.0070.00815.43
7.1.150.0050.00715.73
7.1.140.0060.00515.66
7.1.130.0080.00515.29
7.1.120.0070.00315.77
7.1.110.0020.01015.58
7.1.100.0100.00216.37
7.1.90.0020.01115.54
7.1.80.0050.01015.63
7.1.70.0020.00916.02
7.1.60.0070.01116.81
7.1.50.0080.00816.01
7.1.40.0080.00915.53
7.1.30.0030.01215.45
7.1.20.0060.00615.61
7.1.10.0020.01015.51
7.1.00.0030.01817.93
7.0.330.0080.00515.16
7.0.320.0040.00815.04
7.0.310.0060.00815.15
7.0.300.0060.00815.25
7.0.290.0000.01415.23
7.0.280.0050.00715.45
7.0.270.0020.00715.10
7.0.260.0050.01015.33
7.0.250.0030.00815.22
7.0.240.0000.01215.37
7.0.230.0080.00615.29
7.0.220.0070.00415.33
7.0.210.0070.00315.23
7.0.200.0070.00415.70
7.0.190.0070.00515.24
7.0.180.0050.00615.36
7.0.170.0040.00515.41
7.0.160.0020.00815.33
7.0.150.0070.00715.23
7.0.140.0060.02817.52
7.0.130.0060.00415.12
7.0.120.0040.00615.26
7.0.110.0060.00514.97
7.0.100.0120.00515.35
7.0.90.0070.00715.37
7.0.80.0050.00615.19
7.0.70.1480.01816.76
7.0.60.0070.03416.78
7.0.50.0060.03116.26
7.0.40.0080.02715.59
7.0.30.0110.02815.70
7.0.20.0180.02915.52
7.0.10.0050.02115.50
7.0.00.0070.01515.61
5.6.400.0040.00914.32
5.6.390.0020.01214.11
5.6.380.0050.00814.30
5.6.370.0030.00614.21
5.6.360.0080.00714.21
5.6.350.0080.00614.29
5.6.340.0060.00613.89
5.6.330.0030.00814.30
5.6.320.0090.00614.30
5.6.310.0060.00314.24
5.6.300.0050.01114.09
5.6.290.0070.00614.10
5.6.280.0050.02916.40
5.6.270.0020.01114.14
5.6.260.0110.00514.33
5.6.250.0050.01014.20
5.6.240.0110.00514.14
5.6.230.0020.01014.23
5.6.220.0020.00714.06
5.6.210.0050.03116.21
5.6.200.0070.02015.49
5.6.190.0020.02416.28
5.6.180.0140.03316.09
5.6.170.0090.03216.12
5.6.160.0050.02716.27
5.6.150.0020.02215.49
5.6.140.0050.01815.38
5.6.130.0080.03115.38
5.6.120.0060.03416.40
5.6.110.0060.03116.44
5.6.100.0010.02416.40
5.6.90.0100.01916.44
5.6.80.0040.02716.18
5.6.70.0120.02916.15
5.6.60.0070.00913.90
5.6.50.0070.00914.09
5.6.40.0080.00414.18
5.6.30.0070.00614.14
5.6.20.0070.00814.21
5.6.10.0060.00913.96
5.6.00.0010.01013.94
5.5.380.0030.00914.16
5.5.370.0080.00614.04
5.5.360.0050.00814.13
5.5.350.0030.03416.11
5.5.340.0090.01815.29
5.5.330.0100.02816.09
5.5.320.0020.03416.24
5.5.310.0110.03216.10
5.5.300.0110.02315.36
5.5.290.0030.02315.55
5.5.280.0080.03416.37
5.5.270.0080.01916.32
5.5.260.0100.03116.39
5.5.250.0060.03016.09
5.5.240.0040.02315.99
5.5.230.0050.00713.88
5.5.220.0050.00713.96
5.5.210.0070.00713.83
5.5.200.0070.00513.89
5.5.190.0030.01214.01
5.5.180.0030.01214.13
5.5.170.0040.01314.03
5.5.160.0030.00813.78
5.5.150.0060.00813.92
5.5.140.0040.01014.05
5.5.130.0060.00813.94
5.5.120.0050.00813.91
5.5.110.0050.01014.17
5.5.100.0050.00813.75
5.5.90.0040.00913.93
5.5.80.0080.00513.91
5.5.70.0070.00914.05
5.5.60.0070.00713.99
5.5.50.0050.00713.94
5.5.40.0070.00714.03
5.5.30.0090.00513.84
5.5.20.0050.00814.04
5.5.10.0090.00513.99
5.5.00.0090.00513.94
5.4.450.0110.03414.06
5.4.440.0290.02614.04
5.4.430.0160.02114.03
5.4.420.0310.02313.97
5.4.410.0220.02614.04
5.4.400.0310.02113.88
5.4.390.0400.02213.92
5.4.380.0140.01913.74
5.4.370.0090.02113.73
5.4.360.0140.01313.81
5.4.350.0090.01611.55
5.4.340.0060.01511.62
5.4.330.0090.00111.41
5.4.320.0050.01611.76
5.4.310.0060.01611.71
5.4.300.0050.01911.73
5.4.290.0100.02011.71
5.4.280.0050.01911.68
5.4.270.0100.01311.68
5.4.260.0050.01411.77
5.4.250.0040.02313.84
5.4.240.0110.01713.86
5.4.230.0070.01813.87
5.4.220.0070.01913.93
5.4.210.0060.01913.87
5.4.200.0050.02113.86
5.4.190.0060.02113.85
5.4.180.0020.02413.89
5.4.170.0050.02313.92
5.4.160.0050.02113.88
5.4.150.0060.02113.86
5.4.140.0060.01913.06
5.4.130.0080.02613.01
5.4.120.0090.01813.09
5.4.110.0030.02213.10
5.4.100.0040.02113.09
5.4.90.0090.02013.06
5.4.80.0070.01913.06
5.4.70.0080.01813.04
5.4.60.0040.02213.02
5.4.50.0040.02012.98
5.4.40.0060.01813.04
5.4.30.0010.02413.10
5.4.20.0080.01813.11
5.4.10.0060.02113.12
5.4.00.0040.01912.89
5.3.290.0040.01811.81
5.3.280.0040.02212.35
5.3.270.0070.01912.42
5.3.260.0070.01912.42
5.3.250.0040.02712.43
5.3.240.0080.02612.44
5.3.230.0050.02212.44
5.3.220.0060.02712.43
5.3.210.0090.02512.40
5.3.200.0060.02012.43
5.3.190.0040.02212.45
5.3.180.0060.01912.43
5.3.170.0080.01912.37
5.3.160.0040.02012.47
5.3.150.0040.02112.42
5.3.140.0030.02312.39
5.3.130.0040.02312.34
5.3.120.0070.01912.45
5.3.110.0070.01912.40
5.3.100.0030.02812.22
5.3.90.0100.02012.21
5.3.80.0080.02212.27
5.3.70.0040.02212.29
5.3.60.0080.02112.23
5.3.50.0020.02312.22
5.3.40.0050.02612.13
5.3.30.0080.01812.18
5.3.20.0070.01812.17
5.3.10.0070.01812.12
5.3.00.0050.01812.04
5.2.170.0030.04711.33
5.2.160.0100.03711.11
5.2.150.0070.05011.24
5.2.140.0130.03711.13
5.2.130.0030.04711.08
5.2.120.0070.03711.11
5.2.110.0030.04010.96
5.2.100.0030.05310.94
5.2.90.0070.04011.18
5.2.80.0000.04311.26
5.2.70.0030.04311.07
5.2.60.0100.03711.14
5.2.50.0030.04011.00
5.2.40.0030.04011.10
5.2.30.0130.03311.16
5.2.20.0030.04011.13
5.2.10.0070.04710.70
5.2.00.0070.04010.82
5.1.60.0070.0309.92
5.1.50.0100.03010.00
5.1.40.0100.04310.04
5.1.30.0030.03710.17
5.1.20.0030.04010.35
5.1.10.0100.04710.31
5.1.00.0070.05010.17
5.0.50.0070.0308.51
5.0.40.0100.0338.49
5.0.30.0030.0508.43
5.0.20.0000.0408.18
5.0.10.0030.0408.03
5.0.00.0070.0538.27
4.4.90.0070.0207.36
4.4.80.0000.0237.36
4.4.70.0000.0237.36
4.4.60.0000.0237.36
4.4.50.0000.0237.36
4.4.40.0000.0507.36
4.4.30.0030.0207.36
4.4.20.0070.0177.36
4.4.10.0030.0237.36
4.4.00.0000.0377.36
4.3.110.0100.0207.36
4.3.100.0030.0277.36
4.3.90.0070.0237.36
4.3.80.0000.0377.36
4.3.70.0070.0177.36
4.3.60.0030.0207.36
4.3.50.0000.0237.36
4.3.40.0070.0277.36
4.3.30.0030.0207.36
4.3.20.0070.0237.36
4.3.10.0030.0207.36
4.3.00.0070.0277.30

preferences:
61.69 ms | 400 KiB | 5 Q