3v4l.org

run code in 300+ PHP versions simultaneously
<?php header("Content-type: image/png"); $sizex=800; $sizey=800; $img = imagecreatetruecolor(3 * $sizex,$sizey); $r = imagecolorallocate($img,255, 0, 0); $g = imagecolorallocate($img,0, 255, 0); $b = imagecolorallocate($img,0, 0, 255); imagefilledrectangle($img, 0, 0, 3 * $sizex, $sizey, imagecolorallocate($img, 255, 255, 255)); $p = 0; for($i=0; $i < 100000; $i++) { $np = rand(0,$sizex); imagesetpixel($img, $p, $np, $r); $p = $np; } $p = 0; for($i=0; $i < 100000; $i++) { $np = mt_rand(0,$sizex); imagesetpixel($img, $p + $sizex, $np, $g); $p = $np; } $p = 0; for($i=0; $i < 100000; $i++) { $np = floor($sizex*(hexdec(bin2hex(openssl_random_pseudo_bytes(4)))/0xffffffff)); imagesetpixel($img, $p + (2*$sizex), $np, $b); $p = $np; } imagepng($img); imagedestroy($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)
8.1.10.0030.00617.58
8.1.00.0030.00817.54
8.0.140.0000.00816.92
8.0.130.0160.00516.70
8.0.120.0170.00516.91
8.0.110.0160.00616.81
8.0.100.0120.00916.84
8.0.90.0190.00316.89
8.0.80.0120.00816.89
8.0.70.0160.00416.79
8.0.60.0160.00516.95
8.0.50.0170.00416.92
8.0.30.0140.00616.75
8.0.20.0130.00817.00
8.0.10.0190.00317.11
8.0.00.0030.01016.93
7.4.270.0190.00516.63
7.4.260.0130.01216.43
7.4.250.0190.00416.59
7.4.240.0260.00016.61
7.4.230.0120.01216.64
7.4.220.0100.01016.63
7.4.210.0150.00616.60
7.4.200.0120.00616.59
7.4.190.0170.00416.57
7.4.180.0120.00916.73
7.4.160.0080.01216.52
7.4.150.0180.00316.50
7.4.140.0170.00316.41
7.4.130.0160.00316.44
7.4.120.0190.00016.49
7.4.110.0140.00516.61
7.4.100.0130.00616.46
7.4.90.0180.00316.54
7.4.80.0200.00016.54
7.4.70.0190.00016.50
7.4.60.0170.00316.57
7.4.50.0140.00516.40
7.4.40.0150.00416.40
7.4.30.0110.00816.48
7.4.20.0160.00316.45
7.4.10.0150.00616.50
7.4.00.0150.00616.56
7.3.330.0120.00516.29
7.3.320.0160.00416.48
7.3.310.0180.00316.25
7.3.300.0220.00416.32
7.3.290.0110.00516.36
7.3.280.0140.00316.25
7.3.270.0210.00316.04
7.3.260.0180.00516.11
7.3.250.0180.00616.32
7.3.240.0160.00416.27
7.3.230.0140.00616.18
7.3.220.0220.00016.11
7.3.210.0100.00715.99
7.3.200.0040.00616.18
7.3.190.0150.00316.02
7.3.180.0210.00016.05
7.3.170.0200.00016.21
7.3.160.0210.00016.18
7.3.150.0140.00016.26
7.3.140.0040.00416.01
7.3.130.0050.00216.19
7.3.120.0170.00416.27
7.3.110.0120.00816.23
7.3.100.0120.00816.11
7.3.90.0170.00316.54
7.3.80.0180.00316.33
7.3.70.0210.00016.26
7.3.60.0160.00516.39
7.3.50.0140.00716.38
7.3.40.0130.00716.20
7.3.30.0110.00916.30
7.3.20.0240.00018.01
7.3.10.0140.00717.92
7.3.00.0130.01018.02
7.2.340.0140.00616.35
7.2.330.0120.00816.07
7.2.320.0200.00016.38
7.2.310.0120.00916.32
7.2.300.0130.00916.16
7.2.290.0190.00316.33
7.2.280.0130.00716.10
7.2.270.0170.00416.19
7.2.260.0190.00316.33
7.2.250.0120.00816.33
7.2.240.0200.00316.07
7.2.230.0140.00616.01
7.2.220.0170.00316.05
7.2.210.0150.00616.32
7.2.200.0180.00516.29
7.2.190.0180.00416.44
7.2.180.0130.00916.45
7.2.170.0180.00416.38
7.2.160.0120.00816.35
7.2.150.0190.00318.21
7.2.140.0090.01218.44
7.2.130.0180.00418.43
7.2.120.0180.00418.29
7.2.110.0150.00618.16
7.2.100.0210.00018.20
7.2.90.0160.00518.29
7.2.80.0180.00318.05
7.2.70.0210.00018.25
7.2.60.0180.00818.26
7.2.50.0150.00618.37
7.2.40.0150.00618.43
7.2.30.0120.01218.35
7.2.20.0140.00918.35
7.2.10.0160.00618.34
7.2.00.0070.00918.90
7.1.330.0130.00317.16
7.1.320.0110.00617.23
7.1.310.0120.00416.98
7.1.300.0120.00317.38
7.1.290.0160.00017.02
7.1.280.0150.00317.21
7.1.270.0120.00417.29
7.1.260.0100.00517.09
7.1.250.0150.00517.19
7.1.240.0150.00317.06
7.1.230.0130.00317.32
7.1.220.0120.00317.07
7.1.210.0100.00617.07
7.1.200.0140.00217.07
7.1.190.0110.00417.11
7.1.180.0120.00516.95
7.1.170.0120.00417.06
7.1.160.0170.00017.27
7.1.150.0140.00317.21
7.1.140.0090.00917.07
7.1.130.0110.00617.05
7.1.120.0200.00017.22
7.1.110.0170.00217.15
7.1.100.0110.00817.01
7.1.90.0130.00517.00
7.1.80.0100.00917.20
7.1.70.0130.00617.15
7.1.60.0130.00918.27
7.1.50.0130.00816.95
7.1.40.0190.00017.13
7.1.30.0130.00717.06
7.1.20.0090.01117.00
7.1.10.0160.00317.07
7.1.00.0150.03319.81
7.0.330.0160.00316.96
7.0.320.0170.00316.86
7.0.310.0170.00016.68
7.0.300.0130.00317.07
7.0.290.0110.00816.86
7.0.280.0230.00017.06
7.0.270.0240.00016.88
7.0.260.0200.00316.94
7.0.250.0200.00316.83
7.0.240.0200.00217.13
7.0.230.0220.00717.03
7.0.220.0220.00016.83
7.0.210.0220.00316.96
7.0.200.0090.00616.80
7.0.190.0200.00416.76
7.0.180.0210.00316.98
7.0.170.0190.00517.13
7.0.160.0130.00916.74
7.0.150.0180.00616.66
7.0.140.0160.03219.52
7.0.130.0220.00316.78
7.0.120.0150.00816.92
7.0.110.0180.00616.86
7.0.100.0160.03718.34
7.0.90.0110.04218.44
7.0.80.0150.02718.35
7.0.70.0150.03618.29
7.0.60.0220.04418.43
7.0.50.0290.02518.61
7.0.40.0140.02218.44
7.0.30.0120.04218.43
7.0.20.0130.04318.38
7.0.10.0170.04318.57
7.0.00.0080.04918.50
5.6.400.0170.00415.76
5.6.390.0120.00915.55
5.6.380.0130.00915.69
5.6.370.0180.00515.50
5.6.360.0170.00415.51
5.6.350.0220.00015.69
5.6.340.0140.00715.65
5.6.330.0150.00615.46
5.6.320.0210.00015.53
5.6.310.0130.00915.78
5.6.300.0130.01015.59
5.6.290.0190.00315.56
5.6.280.0120.03818.33
5.6.270.0190.00315.76
5.6.260.0170.00615.72
5.6.250.0100.03818.04
5.6.240.0100.04518.07
5.6.230.0150.04018.18
5.6.220.0110.04318.15
5.6.210.0090.04518.06
5.6.200.0110.04418.47
5.6.190.0110.03718.44
5.6.180.0160.04018.39
5.6.170.0110.04118.31
5.6.160.0090.04618.30
5.6.150.0060.05018.46
5.6.140.0070.04718.35
5.6.130.0160.02518.23
5.6.120.0140.04018.41
5.6.110.0160.03518.35
5.6.100.0130.03518.30
5.6.90.0140.04218.33
5.6.80.0120.03717.96
5.6.70.0070.03818.11
5.6.60.0120.03318.05
5.6.50.0120.03718.08
5.6.40.0110.04618.05
5.6.30.0110.03818.05
5.6.20.0070.04417.99
5.6.10.0110.03818.01
5.6.00.0120.03018.07
5.5.380.0190.03318.15
5.5.370.0130.02318.08
5.5.360.0070.04617.89
5.5.350.0150.04318.09
5.5.340.0120.04218.32
5.5.330.0120.03918.13
5.5.320.0060.05118.24
5.5.310.0110.04418.19
5.5.300.0100.04518.21
5.5.290.0140.04118.10
5.5.280.0120.03918.07
5.5.270.0170.04018.29
5.5.260.0120.05318.05
5.5.250.0130.03518.04
5.5.240.0060.03017.94
5.5.230.0110.02917.90
5.5.220.0100.04117.85
5.5.210.0080.02817.88
5.5.200.0100.02817.85
5.5.190.0120.04117.83
5.5.180.0140.03817.80
5.5.170.0180.00015.31
5.5.160.0060.02517.79
5.5.150.0150.03117.76
5.5.140.0100.03417.86
5.5.130.0080.02617.76
5.5.120.0090.02317.87
5.5.110.0140.02517.77
5.5.100.0150.02817.79
5.5.90.0120.01817.82
5.5.80.0080.02417.85
5.5.70.0090.04117.92
5.5.60.0100.01817.87
5.5.50.0140.02717.87
5.5.40.0120.01717.77
5.5.30.0080.02917.69
5.5.20.0050.02617.93
5.5.10.0070.02317.80
5.5.00.0080.02717.88
5.4.450.0060.03715.83
5.4.440.0120.03715.94
5.4.430.0120.03715.86
5.4.420.0100.03815.97
5.4.410.0100.04015.73
5.4.400.0090.04215.71
5.4.390.0140.02415.73
5.4.380.0040.02715.78
5.4.370.0100.02315.77
5.4.360.0070.03515.74
5.4.350.0090.04315.69
5.4.340.0090.04615.92
5.4.330.0150.00012.42
5.4.320.0110.03315.80
5.4.310.0040.04015.78
5.4.300.0080.02215.85
5.4.290.0110.01915.89
5.4.280.0080.02215.76
5.4.270.0130.02815.79
5.4.260.0080.02215.84
5.4.250.0080.02315.70
5.4.240.0100.01615.76
5.4.230.0070.02015.72
5.4.220.0060.02415.56
5.4.210.0090.02015.65
5.4.200.0110.01715.57
5.4.190.0080.02015.57
5.4.180.0070.02015.55
5.4.170.0110.03215.71
5.4.160.0070.02215.48
5.4.150.0070.02015.73
5.4.140.0050.02314.32
5.4.130.0060.03014.38
5.4.120.0090.01814.23
5.4.110.0130.01514.34
5.4.100.0110.01514.35
5.4.90.0070.01814.37
5.4.80.0080.01814.31
5.4.70.0050.02214.28
5.4.60.0070.02014.36
5.4.50.0060.02314.28
5.4.40.0090.01814.27
5.4.30.0040.02114.28
5.4.20.0090.01714.38
5.4.10.0070.02514.37
5.4.00.0050.02213.97

preferences:
27.91 ms | 401 KiB | 5 Q