3v4l.org

run code in 300+ PHP versions simultaneously
<?php $values = array( 'foo' => 10, 'bar' => 20, 'baz' => 30 ); $newarray = array(); foreach($values as $k => $v) { $newarray[$k] = $v; if($k == 'bar') $newarray['qux'] = 21; } echo implode(' ', $newarray);

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.4.20.0070.01017.77
8.4.10.0090.00017.50
8.3.150.0150.00417.08
8.3.140.0000.00816.46
8.3.130.0100.00016.79
8.3.120.0090.00018.92
8.3.110.0090.00020.94
8.3.100.0060.00324.06
8.3.90.0030.00526.77
8.3.80.0060.00316.63
8.3.70.0180.00416.58
8.3.60.0100.01016.63
8.3.50.0120.00622.04
8.3.40.0040.01118.94
8.3.30.0070.00719.17
8.3.20.0100.00720.19
8.3.10.0090.00021.79
8.3.00.0030.00517.93
8.2.270.0140.00417.40
8.2.260.0000.00816.79
8.2.250.0050.00318.34
8.2.240.0040.00419.02
8.2.230.0030.00522.58
8.2.220.0000.01437.54
8.2.210.0080.00026.77
8.2.200.0090.00018.29
8.2.190.0040.01116.58
8.2.180.0140.00425.92
8.2.170.0070.00719.11
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0040.01126.16
8.2.120.0000.00820.93
8.2.110.0030.00720.92
8.2.100.0060.00618.03
8.2.90.0230.00317.77
8.2.80.0170.00419.01
8.2.70.0150.00617.65
8.2.60.0190.00317.53
8.2.50.0190.00118.50
8.2.40.0160.00418.23
8.2.30.0130.00618.30
8.2.20.0120.00618.12
8.2.10.0150.00318.25
8.2.00.0090.00818.22
8.1.310.0140.00416.93
8.1.300.0070.01019.45
8.1.290.0000.01030.84
8.1.280.0060.00925.92
8.1.270.0000.00823.88
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0030.00622.11
8.1.230.0030.00720.88
8.1.220.0170.00217.49
8.1.210.0140.00818.01
8.1.200.0110.01017.22
8.1.190.0170.00517.17
8.1.180.0160.00718.21
8.1.170.0140.00418.45
8.1.160.0110.00719.56
8.1.150.0140.00619.02
8.1.140.0140.00318.00
8.1.130.0150.00518.13
8.1.120.0130.00517.95
8.1.110.0140.00418.01
8.1.100.0130.00618.04
8.1.90.0140.00417.99
8.1.80.0140.00418.08
8.1.70.0150.00318.02
8.1.60.0140.00518.17
8.1.50.0110.00818.16
8.1.40.0140.00518.11
8.1.30.0130.00518.09
8.1.20.0170.00318.28
8.1.10.0150.00517.93
8.1.00.0160.00417.79
8.0.300.0150.00418.54
8.0.290.0100.00548.05
8.0.280.0150.00318.27
8.0.270.0160.00417.72
8.0.260.0150.00417.87
8.0.250.0130.00317.74
8.0.240.0120.00617.77
8.0.230.0110.00717.76
8.0.220.0080.01017.72
8.0.210.0120.00617.74
8.0.200.0110.00717.75
8.0.190.0110.00717.73
8.0.180.0130.00517.71
8.0.170.0110.00817.76
8.0.160.0140.00417.76
8.0.150.0130.00617.71
8.0.140.0120.00617.36
8.0.130.0130.00416.63
8.0.120.0110.00517.28
8.0.110.0120.00317.31
8.0.100.0090.00517.16
8.0.90.0110.00317.20
8.0.80.0120.00417.15
8.0.70.0100.00517.20
8.0.60.0120.00317.19
8.0.50.0070.00617.16
8.0.30.0110.00517.13
8.0.20.0090.00717.21
8.0.10.0100.00617.22
8.0.00.0090.00717.17
7.4.330.0100.00217.19
7.4.320.0120.00417.62
7.4.300.0100.00517.62
7.4.290.0120.00417.64
7.4.280.0140.00217.65
7.4.270.0110.00617.21
7.4.260.0140.00517.18
7.4.250.0120.00517.05
7.4.240.0060.00616.99
7.4.230.0120.00316.92
7.4.220.0110.00316.92
7.4.210.0100.00516.96
7.4.200.0110.00216.95
7.4.190.0100.00616.99
7.4.180.0120.00317.08
7.4.160.0110.00616.86
7.4.150.0110.00516.87
7.4.140.0100.00716.96
7.4.130.0080.00716.78
7.4.120.0080.00816.75
7.4.110.0100.00716.71
7.4.100.0100.00616.77
7.4.90.0090.00716.74
7.4.80.0090.00816.95
7.4.70.0110.00616.71
7.4.60.0100.00816.65
7.4.50.0070.01016.66
7.4.40.0100.00716.65
7.4.30.0100.00716.66
7.4.20.0110.00616.65
7.4.10.0090.00816.41
7.4.00.0100.00716.32
7.3.330.0110.00416.41
7.3.320.0120.00416.43
7.3.310.0110.00416.90
7.3.300.0100.00416.84
7.3.290.0080.00516.68
7.3.280.0100.00516.60
7.3.270.0110.00416.76
7.3.260.0100.00616.65
7.3.250.0090.00616.71
7.3.240.0100.00616.63
7.3.230.0080.00816.60
7.3.220.0100.00516.59
7.3.210.0100.00516.61
7.3.200.0110.00616.84
7.3.190.0110.00516.60
7.3.180.0100.00616.58
7.3.170.0110.00516.57
7.3.160.0100.00616.53
7.3.150.0100.00616.53
7.3.140.0080.00816.56
7.3.130.0100.00716.24
7.3.120.0090.00716.31
7.3.110.0110.00716.17
7.3.100.0110.00516.11
7.3.90.0090.00816.14
7.3.80.0090.00716.05
7.3.70.0110.00615.88
7.3.60.0100.00715.91
7.3.50.0090.00815.89
7.3.40.0080.00915.88
7.3.30.0090.00815.90
7.3.20.0130.00616.48
7.3.10.0120.00616.40
7.3.00.0130.00516.41
7.2.340.0100.00816.66
7.2.330.0120.00616.64
7.2.320.0130.00616.64
7.2.310.0110.00716.62
7.2.300.0120.00716.66
7.2.290.0110.00616.57
7.2.280.0100.00816.64
7.2.270.0110.00816.65
7.2.260.0090.00916.36
7.2.250.0110.00716.35
7.2.240.0120.00716.32
7.2.230.0110.00816.29
7.2.220.0100.00816.17
7.2.210.0110.00716.11
7.2.200.0090.00916.05
7.2.190.0090.00915.97
7.2.180.0100.00816.02
7.2.170.0100.00816.03
7.2.160.0090.00916.05
7.2.150.0110.00816.63
7.2.140.0130.00816.64
7.2.130.0140.00716.71
7.2.120.0130.00816.58
7.2.110.0100.00816.57
7.2.100.0120.00616.61
7.2.90.0110.00816.66
7.2.80.0110.00816.65
7.2.70.0140.00816.65
7.2.60.0110.00816.67
7.2.50.0120.00816.55
7.2.40.0120.00816.72
7.2.30.0140.00816.75
7.2.20.0120.00916.73
7.2.10.0130.00916.73
7.2.00.0140.00716.78
7.1.330.0130.00815.95
7.1.320.0120.00815.78
7.1.310.0130.00715.66
7.1.300.0140.00915.52
7.1.290.0170.00715.56
7.1.280.0160.00715.53
7.1.270.0130.00815.52
7.1.260.0150.00715.57
7.1.250.0150.00715.58
7.1.240.0140.00715.50
7.1.230.0160.00615.46
7.1.220.0170.00715.49
7.1.210.0170.00815.57
7.1.200.0160.00815.58
7.1.190.0130.00815.57
7.1.180.0130.00715.55
7.1.170.0140.00715.52
7.1.160.0240.00615.58
7.1.150.0150.00715.63
7.1.140.0130.00815.61
7.1.130.0160.00815.69
7.1.120.0160.00715.68
7.1.110.0150.00715.70
7.1.100.0150.00715.70
7.1.90.0140.00715.66
7.1.80.0130.00815.64
7.1.70.0150.00715.56
7.1.60.0150.00817.50
7.1.50.0160.00717.43
7.1.40.0160.00817.42
7.1.30.0160.00717.42
7.1.20.0190.00617.40
7.1.10.0150.00715.55
7.1.00.0150.00715.53
7.0.330.0160.00615.23
7.0.320.0150.00715.16
7.0.310.0120.00815.24
7.0.300.0140.00615.18
7.0.290.0160.00715.32
7.0.280.0150.00615.30
7.0.270.0150.00615.41
7.0.260.0160.00715.39
7.0.250.0180.00715.41
7.0.240.0170.00615.44
7.0.230.0160.00715.47
7.0.220.0150.00715.41
7.0.210.0160.00815.31
7.0.200.0160.00715.32
7.0.190.0210.00615.30
7.0.180.0150.00715.31
7.0.170.0150.00715.29
7.0.160.0150.00815.25
7.0.150.0280.00615.21
7.0.140.0160.00615.25
7.0.130.0160.00615.30
7.0.120.0170.00715.23
7.0.110.0170.00615.23
7.0.100.0160.00615.19
7.0.90.0150.00715.18
7.0.80.0170.00715.15
7.0.70.0160.00715.18
7.0.60.0150.00915.22
7.0.50.0150.00815.25
7.0.40.0170.00715.31
7.0.30.0160.00715.28
7.0.20.0190.00715.25
7.0.10.0140.00815.27
7.0.00.0150.00815.27
5.6.400.0120.01015.61
5.6.390.0140.00815.62
5.6.380.0140.00815.61
5.6.370.0140.00715.64
5.6.360.0120.00815.60
5.6.350.0140.00815.58
5.6.340.0140.00715.64
5.6.330.0140.00815.61
5.6.320.0130.00815.56
5.6.310.0140.00815.58
5.6.300.0140.01316.17
5.6.290.0130.01416.20
5.6.280.0130.01416.22
5.6.270.0120.01416.22
5.6.260.0130.01316.18
5.6.250.0140.01316.18
5.6.240.0140.01416.24
5.6.230.0140.01316.19
5.6.220.0140.01416.21
5.6.210.0140.01516.22
5.6.200.0140.01316.23
5.6.190.0140.01316.24
5.6.180.0140.01516.20
5.6.170.0160.01216.23
5.6.160.0140.01516.22
5.6.150.0130.01416.20
5.6.140.0150.01316.25
5.6.130.0140.01416.19
5.6.120.0150.01316.19
5.6.110.0140.01316.20
5.6.100.0140.01416.20
5.6.90.0140.01516.14
5.6.80.0130.01416.09
5.6.70.0120.01416.08
5.6.60.0150.01416.06
5.6.50.0140.01316.07
5.6.40.0130.01416.09
5.6.30.0140.01316.05
5.6.20.0130.01416.02
5.6.10.0120.01516.07
5.6.00.0120.01316.04
5.5.380.0140.01215.81
5.5.370.0130.01415.77
5.5.360.0120.01515.76
5.5.350.0120.01515.79
5.5.340.0140.01215.83
5.5.330.0140.01315.84
5.5.320.0130.01215.85
5.5.310.0120.01415.87
5.5.300.0110.01515.79
5.5.290.0140.01315.79
5.5.280.0130.01415.78
5.5.270.0120.01515.79
5.5.260.0140.01415.80
5.5.250.0140.01315.80
5.5.240.0130.01315.75
5.5.230.0130.01315.69
5.5.220.0120.01415.65
5.5.210.0120.01415.78
5.5.200.0140.01215.70
5.5.190.0140.01215.65
5.5.180.0130.01315.69
5.5.170.0140.00815.49
5.5.160.0130.01315.69
5.5.150.0120.01315.69
5.5.140.0120.01515.68
5.5.130.0140.01215.64
5.5.120.0120.01515.67
5.5.110.0130.01315.70
5.5.100.0130.01315.72
5.5.90.0110.01515.73
5.5.80.0130.01315.67
5.5.70.0120.01415.71
5.5.60.0140.01115.65
5.5.50.0120.01415.61
5.5.40.0120.01315.58
5.5.30.0130.01415.66
5.5.20.0140.01215.64
5.5.10.0130.01315.62
5.5.00.0140.01315.63
5.4.450.0120.01113.65
5.4.440.0090.01313.65
5.4.430.0100.01213.62
5.4.420.0090.01313.64
5.4.410.0100.01313.65
5.4.400.0110.01213.57
5.4.390.0110.01213.57
5.4.380.0110.01113.54
5.4.370.0110.01013.59
5.4.360.0100.01113.56
5.4.350.0100.01113.58
5.4.340.0100.01113.58
5.4.330.0110.00612.88
5.4.320.0110.01113.59
5.4.310.0100.01113.60
5.4.300.0120.01013.57
5.4.290.0120.01013.59
5.4.280.0090.01213.57
5.4.270.0100.01013.58
5.4.260.0110.01113.57
5.4.250.0110.01113.56
5.4.240.0100.01213.56
5.4.230.0100.01013.52
5.4.220.0110.01113.54
5.4.210.0100.01113.52
5.4.200.0110.01113.51
5.4.190.0110.01213.52
5.4.180.0110.01113.53
5.4.170.0120.01013.53
5.4.160.0100.01113.53
5.4.150.0100.01213.52
5.4.140.0110.01113.35
5.4.130.0090.01113.32
5.4.120.0090.01113.31
5.4.110.0100.01113.31
5.4.100.0100.01113.32
5.4.90.0100.01013.33
5.4.80.0100.01113.35
5.4.70.0110.01013.36
5.4.60.0110.01013.36
5.4.50.0110.01013.32
5.4.40.0100.01013.33
5.4.30.0110.01113.35
5.4.20.0120.01013.35
5.4.10.0100.01213.33
5.4.00.0100.01113.23

preferences:
32.83 ms | 403 KiB | 5 Q