3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set("display_errors","On"); error_reporting(E_ALL); function without($var){ echo "Certain death\n"; $var.='die fucker DIE!'; echo memory_get_usage(), PHP_EOL; } function with(&$var){ echo "Alive\n"; echo memory_get_usage(), PHP_EOL; } $str = str_repeat('foo', 10000000); echo memory_get_usage(), PHP_EOL; echo "END\n"; with($str); without($str);

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.2.00.0200.02476.23
7.1.70.0570.01074.26
7.1.60.0230.02674.27
7.1.50.0870.03074.39
7.1.00.0070.09079.63
7.0.201.5880.01073.61
7.0.140.0130.08079.16
7.0.60.0500.07776.95
7.0.50.0230.06374.72
7.0.40.0330.08376.68
7.0.30.1230.07376.85
7.0.20.1170.08076.95
7.0.10.0300.08376.81
7.0.00.0300.05076.91
5.6.280.0100.08777.98
5.6.210.0370.08377.73
5.6.200.0200.05775.33
5.6.190.0100.07377.54
5.6.180.1400.07377.69
5.6.170.1100.08377.59
5.6.160.0330.04777.63
5.6.150.0300.09075.39
5.6.140.0300.04775.32
5.6.130.0230.10075.46
5.6.120.0200.08778.23
5.6.110.0330.07078.32
5.6.100.0270.10778.24
5.6.90.0400.09378.21
5.6.80.0200.04377.64
5.5.350.0870.02377.67
5.5.340.0230.10775.19
5.5.330.0130.06377.34
5.5.320.1070.08777.18
5.5.310.1330.08777.43
5.5.300.0400.08775.12
5.5.290.0230.10375.22
5.5.280.0270.10078.04
5.5.270.0170.07377.95
5.5.260.0330.09078.21
5.5.250.0300.04777.91
5.5.240.0670.07777.27
5.4.450.1670.06376.57
5.4.440.4200.07376.66
5.4.430.4200.08076.79
5.4.420.3470.07376.77
5.4.410.3700.08376.52
5.4.400.3230.06776.36
5.4.390.2830.08376.18
5.4.380.1900.08375.82
5.4.370.1530.08375.70
5.4.360.1900.07776.00
5.4.350.2070.06775.73
5.4.340.2430.07775.96
5.4.320.0200.05069.73
5.4.310.0170.05569.72
5.4.300.0200.04869.73
5.4.290.0230.05269.73
5.4.280.0290.05269.63
5.4.270.0200.04869.62
5.4.260.0350.05369.63
5.4.250.0260.05569.63
5.4.240.0210.04669.63
5.4.230.0220.05169.62
5.4.220.0240.05969.62
5.4.210.0250.04269.62
5.4.200.0230.04669.62
5.4.190.0240.04169.61
5.4.180.0210.04669.61
5.4.170.0150.05169.62
5.4.160.0230.04569.62
5.4.150.0210.04569.61
5.4.140.0190.04869.30
5.4.130.0310.05169.29
5.4.120.0310.05669.24
5.4.110.0230.04769.24
5.4.100.0220.04569.24
5.4.90.0280.05769.24
5.4.80.0230.05669.24
5.4.70.0160.05069.23
5.4.60.0240.04969.23
5.4.50.0270.06269.23
5.4.40.0290.05769.23
5.4.30.0290.05469.22
5.4.20.0210.05769.22
5.4.10.0210.04669.22
5.4.00.0180.05068.71
5.3.290.0210.05169.93
5.3.280.0350.05169.87
5.3.270.0360.06069.88
5.3.260.0380.05569.87
5.3.250.0230.04869.88
5.3.240.0220.05969.88
5.3.230.0180.05369.87
5.3.220.0230.04869.84
5.3.210.0270.06669.84
5.3.200.0300.05569.84
5.3.190.0190.05069.84
5.3.180.0260.04569.83
5.3.170.0310.05969.83
5.3.160.0280.05769.83
5.3.150.0340.05369.83
5.3.140.0230.06669.82
5.3.130.0250.06269.81
5.3.120.0230.04669.82
5.3.110.0210.04969.81
5.3.100.0230.04669.32
5.3.90.0280.04669.30
5.3.80.0300.03969.29
5.3.70.0240.04369.29
5.3.60.0260.04669.27
5.3.50.0200.05269.22
5.3.40.0170.04969.21
5.3.30.0240.04269.17
5.3.20.0180.04868.96
5.3.10.0190.04768.92
5.3.00.0240.04268.91
5.2.170.0270.05266.40
5.2.160.0190.05066.40
5.2.150.0230.04166.39
5.2.140.0210.03866.39
5.2.130.0200.03866.36
5.2.120.0220.03966.36
5.2.110.0210.03966.35
5.2.100.0140.04366.35
5.2.90.0190.03966.36
5.2.80.0220.03866.34
5.2.70.0240.03466.34
5.2.60.0200.03866.30
5.2.50.0160.04366.27
5.2.40.0210.04066.25
5.2.30.0270.05166.22
5.2.20.0250.05166.21
5.2.10.0360.04166.11
5.2.00.0160.03737.37
5.1.60.0110.03536.65
5.1.50.0130.03336.64
5.1.40.0140.03536.63
5.1.30.0110.03736.98
5.1.20.0100.03737.00
5.1.10.0100.03536.72
5.1.00.0100.03436.72
5.0.50.0090.03035.21
5.0.40.0110.02535.06
5.0.30.0100.03834.88
5.0.20.0130.02334.83
5.0.10.0130.02334.82
5.0.00.0120.03634.81
4.4.90.0140.02333.24
4.4.80.0120.02533.22
4.4.70.0120.02733.22
4.4.60.0150.02433.22
4.4.50.0150.02133.24
4.4.40.0120.02933.23
4.4.30.0110.02033.22
4.4.20.0130.01933.29
4.4.10.0120.02033.29
4.4.00.0080.03333.25
4.3.110.0120.01933.17
4.3.100.0110.02033.16
4.3.90.0100.02133.14
4.3.80.0110.03033.13
4.3.70.0120.01833.13
4.3.60.0170.01433.13
4.3.50.0150.01733.13
4.3.40.0160.02533.08
4.3.30.0120.02031.89
4.3.20.0130.01831.87
4.3.10.0120.01931.83
4.3.00.1470.03333.02

preferences:
38.89 ms | 400 KiB | 5 Q