3v4l.org

run code in 300+ PHP versions simultaneously
<?php $notes = array( '-Rnote', '-Gnote', '-Ynote', 'note1 -R', '-Gnote1', '-Ynote1', ); $colors = array( '-R' => 'red', '-G' => 'green', '-Y' => 'yellow', ); foreach ($notes as $note ) { If(isset($colors[substr($note,0,2)])){ echo str_replace(substr($note, 0, 2), '<span style="background-color:' . $colors[substr($note, 0, 2)] . '">', $note) . "</span>\n"; }Else{ Echo $note ."\n"; } }

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.00.0130.00920.14
8.4.150.0020.00014.05
8.4.140.0120.01017.66
8.4.130.0130.00717.59
8.4.120.0040.00520.52
8.4.110.0050.00422.50
8.4.100.0120.00917.91
8.4.90.0130.00717.73
8.4.80.0140.00717.66
8.4.70.0140.00717.87
8.4.60.0060.00218.70
8.4.50.0050.00319.69
8.4.40.0130.00717.64
8.4.30.0110.00819.71
8.4.20.0030.01619.45
8.4.10.0090.00319.57
8.3.280.0120.01018.33
8.3.270.0110.00916.57
8.3.260.0100.00916.50
8.3.250.0100.00818.81
8.3.240.0140.00516.73
8.3.230.0130.00716.51
8.3.220.0040.00417.10
8.3.210.0060.00216.66
8.3.200.0120.00716.58
8.3.190.0100.00918.52
8.3.180.0060.00216.58
8.3.170.0140.00416.41
8.3.160.0110.00718.38
8.3.150.0100.01017.39
8.3.140.0110.00716.79
8.3.130.0000.00818.24
8.3.120.0090.00018.91
8.3.110.0090.00620.94
8.3.100.0030.00618.31
8.3.90.0000.00718.46
8.3.80.0090.00019.36
8.3.70.0070.00716.47
8.3.60.0030.01316.47
8.3.50.0130.00316.56
8.3.40.0090.00618.70
8.3.30.0060.01018.64
8.3.20.0040.00420.25
8.3.10.0040.00420.75
8.3.00.0000.00720.35
8.2.290.0110.00920.49
8.2.280.0110.00818.42
8.2.270.0140.00417.01
8.2.260.0120.00319.02
8.2.250.0000.00916.46
8.2.240.0060.00317.28
8.2.230.0120.00022.58
8.2.220.0050.00524.06
8.2.210.0080.00026.77
8.2.200.0060.00316.63
8.2.190.0060.01216.63
8.2.180.0090.00618.05
8.2.170.0100.01022.96
8.2.160.0110.00419.48
8.2.150.0090.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00421.01
8.2.120.0070.00026.35
8.2.110.0100.00022.32
8.2.100.0070.00417.84
8.2.90.0000.00817.75
8.2.80.0000.00819.48
8.2.70.0030.00618.05
8.2.60.0000.00817.63
8.2.50.0030.00517.63
8.2.40.0040.00419.79
8.2.30.0000.00817.82
8.2.20.0040.00418.13
8.2.10.0030.00518.16
8.2.00.0070.00018.07
8.1.330.0090.00916.73
8.1.320.0080.01016.29
8.1.310.0080.00016.52
8.1.300.0130.00617.82
8.1.290.0000.00918.88
8.1.280.0040.01125.92
8.1.270.0040.00422.02
8.1.260.0130.00326.35
8.1.250.0030.00328.09
8.1.240.0000.00921.89
8.1.230.0110.00022.64
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0100.00017.25
8.1.190.0000.00817.09
8.1.180.0040.00418.10
8.1.170.0000.00717.62
8.1.160.0040.00718.84
8.1.150.0040.00420.22
8.1.140.0070.00019.64
8.1.130.0000.00718.90
8.1.120.0040.00417.37
8.1.110.0000.00717.44
8.1.100.0000.00717.35
8.1.90.0000.00817.50
8.1.80.0000.00817.43
8.1.70.0030.00317.35
8.1.60.0040.00417.49
8.1.50.0030.00617.54
8.1.40.0060.00317.54
8.1.30.0040.00417.67
8.1.20.0000.00817.69
8.1.10.0040.00417.57
8.1.00.0040.00417.55
8.0.300.0040.00419.98
8.0.290.0040.00416.75
8.0.280.0050.00217.88
8.0.270.0000.00818.07
8.0.260.0030.00318.43
8.0.250.0040.00416.86
8.0.240.0030.00316.93
8.0.230.0040.00416.96
8.0.220.0040.00416.88
8.0.210.0030.00316.87
8.0.200.0040.00416.96
8.0.190.0060.00316.99
8.0.180.0040.00416.80
8.0.170.0040.00416.97
8.0.160.0050.00216.79
8.0.150.0050.00316.89
8.0.140.0040.00416.82
8.0.130.0060.00013.36
8.0.120.0030.00516.86
8.0.110.0000.00716.75
8.0.100.0030.00316.84
8.0.90.0040.00416.77
8.0.80.0070.00716.95
8.0.70.0050.00216.85
8.0.60.0060.00316.87
8.0.50.0040.00416.75
8.0.30.0110.00917.15
8.0.20.0080.01117.40
8.0.10.0000.00816.83
8.0.00.0120.00616.95
7.4.330.0020.00215.55
7.4.320.0000.00616.42
7.4.300.0060.00016.58
7.4.290.0070.00016.50
7.4.280.0080.00016.52
7.4.270.0050.00316.50
7.4.260.0000.00716.36
7.4.250.0070.00016.57
7.4.240.0030.00616.41
7.4.230.0000.00816.40
7.4.220.0130.01316.46
7.4.210.0060.00816.56
7.4.200.0070.00016.61
7.4.160.0110.00716.57
7.4.150.0090.00917.40
7.4.140.0100.00817.86
7.4.130.0030.02316.58
7.4.120.0130.00816.54
7.4.110.0030.01316.42
7.4.100.0030.01416.60
7.4.90.0130.00316.51
7.4.80.0110.00719.39
7.4.70.0060.01116.55
7.4.60.0160.00016.40
7.4.50.0070.01116.31
7.4.40.0120.00916.30
7.4.30.0110.00616.57
7.4.00.0070.00715.14
7.3.330.0000.00513.09
7.3.320.0000.00513.32
7.3.310.0040.00416.31
7.3.300.0070.00016.36
7.3.290.0040.00416.29
7.3.280.0070.00916.26
7.3.270.0060.01217.40
7.3.260.0130.00816.52
7.3.250.0120.01216.37
7.3.240.0090.01016.38
7.3.230.0040.01516.34
7.3.210.0090.00616.42
7.3.200.0120.00416.45
7.3.190.0100.00616.31
7.3.180.0100.01016.54
7.3.170.0100.00716.39
7.3.160.0100.00716.62
7.2.330.0090.00916.72
7.2.320.0060.01216.35
7.2.310.0080.00816.59
7.2.300.0090.00616.71
7.2.290.0100.00616.52
7.2.60.0000.01416.97
7.1.200.0060.00615.54
7.1.90.0030.01018.07
7.1.80.0040.01218.34
7.1.70.0030.01417.12
7.1.60.0170.01735.14
7.1.50.0230.01034.57
7.1.40.0240.01034.46
7.1.30.0250.00934.59
7.1.20.0170.01434.47
7.1.10.0060.00616.58
7.1.00.0070.01016.60
7.0.230.0090.00617.37
7.0.220.0060.01017.76
7.0.200.0030.01416.70
7.0.190.0100.00816.78
7.0.180.0110.00416.16
7.0.170.0070.01016.12
7.0.160.0090.00316.23
7.0.150.0120.00616.00
7.0.140.0030.01216.19
7.0.130.0030.01116.79
7.0.120.0030.01016.63
7.0.110.0060.01216.49
7.0.100.0060.01216.21
7.0.90.0030.01016.38
7.0.80.0000.01316.51
7.0.70.0060.00816.39
7.0.60.0060.00916.34
7.0.50.0060.00616.42
7.0.40.0050.00816.29
7.0.30.0030.01016.55
7.0.20.0030.00916.53
7.0.10.0000.01516.38
7.0.00.0030.00916.41

preferences:
186.11 ms | 403 KiB | 5 Q