3v4l.org

run code in 300+ PHP versions simultaneously
<?php $w=150; $h=150; $cols=4; $im = imageCreate($w,$h); $del=1.5; $mw = $w/$del; $mh = $h/$del; $c = imageColorAllocate($im, 245, 245, 245); imagefilledrectangle($im, 0, 0, $w, $h, $c); $c = array(rand(0,200),rand(0,200),rand(0,200)); for($zz=0;$zz<5;$zz++) { $im = createPolgon($im, $w, $h, $mw, $mh,5, $c, 75); } header('Content-type: image/jpg'); imagepng($im); imagedestroy($im); function createPolgon($image, $width, $height, $mwidth, $mheight, $count, $color, $merge) { $img = imageCreate($width,$height); $c = imageColorAllocate($img, 245, 245, 245); imagefilledrectangle($img, 0, 0, $width, $height, $c); for($i=0;$i<$count;$i++) { $c = imageColorAllocate($image,$color[0],$color[1],$color[2]); $cnt=3; $values=array(rand(0,$mwidth), rand(0,$mheight),rand(0,$mwidth), rand(0,$mheight),rand(0,$mwidth), rand(0,$mheight)); imagefilledpolygon($image, $values, $cnt, $c); } $rotate = imagerotate($image, 90, 0); imagecopymerge($image, $rotate, 0, 0, 0, 0, $width, $height, 50); $rotate = imagerotate($image, 180, 0); imagecopymerge($image, $rotate, 0, 0, 0, 0, $width, $height, 50); imagecopymerge($img, $image, 0, 0, 0, 0, $width, $height, $merge); return $img; }

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)
7.4.00.0130.00614.91
7.3.120.0100.00714.88
7.3.110.0070.01114.91
7.3.100.0070.00715.03
7.3.90.0110.00014.91
7.3.80.0000.01214.80
7.3.70.0090.00614.68
7.3.60.0030.00914.85
7.3.50.0000.01514.80
7.3.40.0060.00314.82
7.3.30.0040.01114.72
7.3.20.0030.00916.56
7.3.10.0090.00816.47
7.3.00.0070.00416.65
7.2.250.0100.01014.75
7.2.240.0140.00714.94
7.2.230.0100.00715.16
7.2.220.0060.00814.83
7.2.210.0060.00614.64
7.2.200.0110.00414.80
7.2.190.0060.00614.79
7.2.180.0060.00914.80
7.2.170.0090.00314.68
7.2.130.0030.01016.77
7.2.120.0040.00816.84
7.2.110.0040.00916.58
7.2.100.0050.00716.57
7.2.90.0030.00816.80
7.2.80.0010.01316.57
7.2.70.0020.01016.85
7.2.60.0060.00616.73
7.2.50.0100.00616.70
7.2.40.0070.00516.74
7.2.30.0060.00516.78
7.2.20.0000.01416.71
7.2.10.0010.00816.88
7.2.00.0050.00617.38
7.1.330.0080.00615.62
7.1.320.0070.01015.38
7.1.310.0070.00715.48
7.1.300.0050.00515.70
7.1.290.0040.00715.64
7.1.280.0000.01415.44
7.1.270.0030.01015.63
7.1.260.0060.01215.61
7.1.250.0070.00615.44
7.1.70.0030.00616.99
7.1.60.0110.00019.82
7.1.50.0030.01716.54
7.1.00.0070.07322.57
7.0.200.0050.00916.71
7.0.140.0100.06722.17
7.0.70.0070.08021.82
7.0.60.0100.07721.77
7.0.50.0070.08022.16
7.0.40.0030.08020.09
7.0.30.0100.08020.00
7.0.20.0030.08320.18
7.0.10.0070.08020.07
7.0.00.0070.08720.08
5.6.280.0030.07321.10
5.6.220.0030.08320.59
5.6.210.0030.08720.63
5.6.200.0070.05021.12
5.6.190.0000.09021.06
5.6.180.0030.06021.08
5.6.170.0030.08021.15
5.6.160.0030.09320.97
5.6.150.0070.07021.04
5.6.140.0100.06721.07
5.6.130.0070.08021.09
5.6.120.0070.07321.06
5.6.110.0030.08320.96
5.6.100.0100.07321.11
5.6.90.0100.08321.08
5.6.80.0070.08020.42
5.6.70.0130.06720.53
5.6.60.0000.08720.34
5.6.50.0070.07320.46
5.6.40.0000.05320.31
5.6.30.0100.07720.41
5.6.20.0070.07720.30
5.6.10.0030.08020.48
5.6.00.0000.07720.38
5.5.360.0030.08020.41
5.5.350.0030.05020.32
5.5.340.0100.08020.82
5.5.330.0030.05720.91
5.5.320.0100.07320.91
5.5.310.0030.08020.86
5.5.300.0030.08720.93
5.5.290.0030.08720.87
5.5.280.0000.04320.78
5.5.270.0000.06720.77
5.5.260.0030.04320.92
5.5.250.0030.08020.68
5.5.240.0000.06720.18
5.5.230.0030.07320.32
5.5.220.0070.07720.22
5.5.210.0030.06720.28
5.5.200.0070.05320.21
5.5.190.0070.08020.20
5.5.180.0070.07020.23
5.5.160.0100.08020.25
5.5.150.0000.08320.26
5.5.140.0000.08320.29
5.5.130.0000.04720.27
5.5.120.0070.08020.24
5.5.110.0030.06020.17
5.5.100.0100.07320.18
5.5.90.0070.07320.09
5.5.80.0000.05320.14
5.5.70.0070.05320.04
5.5.60.0070.07720.18
5.5.50.0030.08320.15
5.5.40.0100.07320.10
5.5.30.0070.06319.93
5.5.20.0070.07020.07
5.5.10.0070.08020.10
5.5.00.0030.07720.06
5.4.450.0000.07719.49
5.4.440.0070.05319.56
5.4.430.0030.07719.46
5.4.420.0100.07319.20
5.4.410.0000.08719.40
5.4.400.0030.07718.95
5.4.390.0100.07719.10
5.4.380.0100.06319.18
5.4.370.0000.06018.87
5.4.360.0100.07019.09
5.4.350.0030.05019.13
5.4.340.0030.05019.05
5.4.320.0100.07319.05
5.4.310.0100.07319.18
5.4.300.0070.07018.84
5.4.290.0100.07319.02
5.4.280.0100.07019.24
5.4.270.0030.06019.14
5.4.260.0030.07018.86
5.4.250.0030.06318.87
5.4.240.0100.07019.24
5.4.230.0030.07318.94
5.4.220.0030.07319.08
5.4.210.0000.08319.12
5.4.200.0030.06319.18
5.4.190.0000.07719.11
5.4.180.0070.07019.13
5.4.170.0070.05019.13
5.4.160.0030.07019.01
5.4.150.0000.08019.03
5.4.140.0030.05316.43
5.4.130.0070.07016.46
5.4.120.0030.07016.45
5.4.110.0000.06316.33
5.4.100.0070.06716.37
5.4.90.0030.05016.39
5.4.80.0070.07716.41
5.4.70.0070.06016.29
5.4.60.0100.06316.37
5.4.50.0100.06716.41
5.4.40.0000.04316.54
5.4.30.0000.03716.26
5.4.20.0000.04016.47
5.4.10.0070.05716.42
5.4.00.0030.04315.91
5.3.290.0070.07714.70
5.3.280.0000.08314.75
5.3.270.0030.07314.73
5.3.260.0000.07314.66
5.3.250.0000.06714.73
5.3.240.0000.07714.64
5.3.230.0030.05714.61
5.3.220.0070.06314.59
5.3.210.0000.06714.51
5.3.200.0030.05014.70
5.3.190.0000.08314.63
5.3.180.0030.05314.71
5.3.170.0070.07314.68
5.3.160.0030.07314.52
5.3.150.0070.06014.55
5.3.140.0000.06314.56
5.3.130.0030.04014.68
5.3.120.0130.07314.64
5.3.110.0070.07714.58
5.3.100.0030.08014.12
5.3.90.0070.07314.14
5.3.80.0030.07314.06
5.3.70.0000.06313.95
5.3.60.0070.07314.03
5.3.50.0030.06313.91
5.3.40.0000.05314.02
5.3.30.0070.05713.86
5.3.20.0130.07013.64
5.3.10.0070.06313.57
5.3.00.0070.05313.68
5.2.170.0030.06712.30
5.2.160.0030.04712.30
5.2.150.0100.05712.30
5.2.140.0030.04712.30
5.2.130.0100.05012.30
5.2.120.0070.05712.30
5.2.110.0000.05712.30
5.2.100.0000.06312.30
5.2.90.0030.06012.30
5.2.80.0030.05312.30
5.2.70.0030.03312.30
5.2.60.0030.05312.30
5.2.50.0030.06012.30
5.2.40.0000.06712.30
5.2.30.0070.05012.30
5.2.20.0070.04312.30
5.2.10.0070.05712.30
5.2.00.0000.06712.30
5.1.60.0070.05012.30
5.1.50.0030.03312.30
5.1.40.0000.05012.30
5.1.30.0070.05012.30
5.1.20.0100.05012.30
5.1.10.0030.06012.30
5.1.00.0000.06312.30
5.0.50.0000.04312.30
5.0.40.0030.03012.30
5.0.30.0000.06712.30
5.0.20.0030.04312.30
5.0.10.0030.04312.30
5.0.00.0030.06712.30
4.4.90.0000.01712.30
4.4.80.0000.03712.30
4.4.70.0070.01712.30
4.4.60.0030.03312.30
4.4.50.0000.03312.30
4.4.40.0000.05712.30
4.4.30.0000.03712.30
4.4.20.0030.03712.30
4.4.10.0030.03312.30
4.4.00.0000.05312.30
4.3.110.0070.03012.30
4.3.100.0000.03712.30
4.3.90.0000.03712.30
4.3.80.0000.04312.30
4.3.70.0000.03312.30
4.3.60.0000.03712.30
4.3.50.0000.03712.30
4.3.40.0130.04712.30
4.3.30.0000.03712.30
4.3.20.0000.04012.30
4.3.10.0030.03712.30
4.3.00.0000.03712.30

preferences:
36.71 ms | 400 KiB | 5 Q