3v4l.org

run code in 500+ PHP versions simultaneously
<?php function getBalanceColor($balance) : string { if($balance <= 0) { return 'red'; } // The OP said 1, but just in case there's fractional let's use 0 if($balance > 0 && $balance <= 5){ return 'yellow'; } return 'green'; }

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.5.30.0100.00717.17
8.5.20.0090.01119.48
8.5.10.0040.00320.15
8.5.00.0090.01119.92
8.4.180.0140.00719.72
8.4.170.0140.00820.65
8.4.160.0100.01123.05
8.4.150.0060.00616.79
8.4.140.0130.00617.28
8.4.130.0110.00817.37
8.4.120.0080.00422.12
8.4.110.0140.00418.57
8.4.100.0100.01118.73
8.4.90.0100.00920.59
8.4.80.0130.00718.77
8.4.70.0130.00718.79
8.4.60.0100.00818.78
8.4.50.0120.00818.70
8.4.40.0110.00817.90
8.4.30.0150.00320.55
8.4.20.0120.00919.88
8.4.10.0050.00522.01
8.3.300.0110.00920.72
8.3.290.0100.01222.50
8.3.280.0090.01019.92
8.3.270.0110.00916.55
8.3.260.0100.00816.64
8.3.250.0100.00718.75
8.3.240.0100.00716.43
8.3.230.0070.00216.36
8.3.220.0110.00818.77
8.3.210.0110.00516.53
8.3.200.0030.00516.47
8.3.190.0160.00417.13
8.3.180.0110.00718.95
8.3.170.0120.00616.71
8.3.160.0160.00317.06
8.3.150.0140.00418.88
8.3.140.0120.00620.43
8.3.130.0040.01116.40
8.3.120.0030.00620.67
8.3.110.0030.00520.94
8.3.100.0080.00024.06
8.3.90.0040.00426.77
8.3.80.0030.00616.50
8.3.70.0040.01116.58
8.3.60.0070.01418.43
8.3.50.0110.00419.76
8.3.40.0000.01320.21
8.3.30.0070.00718.37
8.3.20.0000.00824.18
8.3.10.0080.00024.66
8.3.00.0080.00026.16
8.2.300.0090.01117.86
8.2.290.0110.00720.44
8.2.280.0140.00618.37
8.2.270.0140.00416.54
8.2.260.0130.00616.43
8.2.250.0100.00516.48
8.2.240.0000.00917.05
8.2.230.0030.00522.58
8.2.220.0040.00437.54
8.2.210.0110.00426.77
8.2.200.0060.00316.38
8.2.190.0140.00418.41
8.2.180.0120.00325.92
8.2.170.0110.00418.89
8.2.160.0110.00422.96
8.2.150.0060.00925.66
8.2.140.0040.00424.66
8.2.130.0090.00026.16
8.2.120.0070.00026.16
8.2.110.0000.01121.00
8.2.100.0070.00417.78
8.2.90.0050.00317.25
8.2.80.0060.00318.60
8.2.70.0090.00017.38
8.2.60.0040.00417.50
8.2.50.0000.00918.05
8.2.40.0080.00019.82
8.2.30.0000.00717.80
8.2.20.0040.00419.16
8.2.10.0070.00017.83
8.2.00.0000.00718.98
8.1.340.0120.00817.30
8.1.330.0100.00916.07
8.1.320.0120.00916.00
8.1.310.0130.00615.93
8.1.300.0070.01118.41
8.1.290.0030.00630.84
8.1.280.0030.01625.92
8.1.270.0000.00824.66
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0080.00419.32
8.1.230.0080.00420.91
8.1.220.0040.00418.43
8.1.210.0050.00318.77
8.1.200.0030.00617.10
8.1.190.0050.00517.11
8.1.180.0030.00518.10
8.1.170.0040.00417.62
8.1.160.0040.00418.89
8.1.150.0000.00718.41
8.1.140.0090.00017.23
8.1.130.0050.00318.93
8.1.120.0030.00617.31
8.1.110.0080.00017.34
8.1.100.0130.00517.25
8.1.90.0130.00317.32
8.1.80.0130.00417.20
8.1.70.0150.00317.32
8.1.60.0060.00617.34
8.1.50.0040.00917.42
8.1.40.0120.00817.20
8.1.30.0120.00317.49
8.1.20.0100.00417.52
8.1.10.0110.00717.36
8.1.00.0160.00317.35
8.0.300.0040.00418.77
8.0.290.0000.00716.68
8.0.280.0000.00718.27
8.0.270.0070.00017.18
8.0.260.0000.00618.18
8.0.250.0050.00316.80
8.0.240.0120.00016.68
8.0.230.0040.01216.69
8.0.220.0000.00916.61
8.0.210.0070.00416.77
8.0.200.0170.00016.70
8.0.190.0100.00516.78
8.0.180.0160.00016.64
8.0.170.0150.00016.75
8.0.160.0160.00016.74
8.0.150.0000.01516.71
8.0.140.0120.00316.73
8.0.130.0110.00516.68
8.0.120.0050.00916.62
8.0.110.0090.00516.61
8.0.100.0090.00616.71
8.0.90.0160.00016.70
8.0.80.0120.00316.74
8.0.70.0130.00316.55
8.0.60.0080.00716.75
8.0.50.0140.00316.64
8.0.30.0060.00616.65
8.0.20.0060.00316.80
8.0.10.0100.00516.78
7.4.330.0050.00015.55
7.4.320.0050.00216.38
7.4.300.0070.00416.42
7.4.290.0090.00516.31
7.4.280.0080.01216.35
7.4.270.0000.01116.38
7.4.260.0110.00316.45
7.4.250.0170.00016.36
7.4.240.0120.00216.40
7.4.230.0160.00016.34
7.4.220.0120.00416.24
7.4.210.0080.00616.42
7.4.200.0070.00716.38
7.4.190.0090.00616.54
7.4.180.0150.00016.56
7.4.160.0100.00316.34
7.4.150.0150.00016.25
7.4.140.0070.00716.37
7.4.130.0040.00416.17
7.4.120.0050.00516.30
7.4.110.0030.00616.27
7.4.100.0090.00016.39
7.4.90.0080.00316.23
7.4.80.0050.00516.15
7.4.70.0110.00016.08
7.4.60.0040.00916.30
7.4.50.0090.00516.24
7.4.40.0100.00016.00
7.4.30.0110.00416.29
7.4.20.0050.00516.23
7.4.10.0110.00016.25
7.4.00.0100.00016.21

preferences:
26.24 ms | 1223 KiB | 5 Q