3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ['baz' => 7]; $b = (string) $a['foo'] ?? 'bar'; $c = (string) $a['baz'] ?? 'some thing else'; $d = (string) ($a['foo'] ?? 'bar'); var_dump($b, $c, $d);

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.120.0090.01122.32
8.4.110.0120.00818.86
8.4.100.0140.00817.69
8.4.90.0070.01217.85
8.4.80.0050.00317.77
8.4.70.0100.00619.56
8.4.60.0130.01018.67
8.4.50.0110.01220.24
8.4.40.0100.01020.36
8.4.30.0180.00317.95
8.4.20.0070.01317.63
8.4.10.0060.01317.57
8.3.250.0050.00318.81
8.3.240.0130.00616.61
8.3.230.0130.00616.54
8.3.220.0060.00316.77
8.3.210.0060.00116.92
8.3.200.0060.00316.62
8.3.190.0120.00616.90
8.3.180.0100.00917.11
8.3.170.0070.01118.81
8.3.160.0120.00616.97
8.3.150.0030.01419.00
8.3.140.0030.00520.73
8.3.130.0070.00417.07
8.3.120.0160.00319.04
8.3.110.0080.00020.94
8.3.100.0110.00724.06
8.3.90.0000.00826.77
8.3.80.0030.00618.68
8.3.70.0090.00916.88
8.3.60.0120.00618.68
8.3.50.0140.00521.08
8.3.40.0090.00918.68
8.3.30.0140.00318.90
8.3.20.0070.00720.19
8.3.10.0070.00021.85
8.3.00.0080.00017.50
8.2.290.0120.00820.53
8.2.280.0060.00318.58
8.2.270.0120.00616.87
8.2.260.0080.01116.73
8.2.250.0040.00418.40
8.2.240.0060.00317.17
8.2.230.0090.00022.58
8.2.220.0060.00337.54
8.2.210.0030.00526.77
8.2.200.0030.00618.54
8.2.190.0090.00616.88
8.2.180.0060.00816.63
8.2.170.0090.00922.96
8.2.160.0090.00919.05
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0040.00422.11
8.2.120.0080.00026.35
8.2.110.0030.00721.12
8.2.100.0040.00817.93
8.2.90.0040.00419.22
8.2.80.0080.00017.97
8.2.70.0080.00017.63
8.2.60.0000.00818.04
8.2.50.0040.00418.10
8.2.40.0050.00520.59
8.2.30.0000.00719.18
8.2.20.0020.00517.62
8.2.10.0000.00718.06
8.2.00.0040.00418.05
8.1.330.0100.00916.73
8.1.320.0080.01216.48
8.1.310.0110.00716.69
8.1.300.0050.00318.29
8.1.290.0060.00330.84
8.1.280.0070.01425.92
8.1.270.0060.00323.96
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0090.00024.00
8.1.230.0070.00419.10
8.1.220.0030.00617.74
8.1.210.0030.00518.77
8.1.200.0030.00617.22
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0000.00818.58
8.1.160.0000.00720.90
8.1.150.0040.00418.77
8.1.140.0070.00019.57
8.1.130.0030.00317.66
8.1.120.0070.00017.36
8.1.110.0050.00317.40
8.1.100.0090.00017.44
8.1.90.0050.00217.49
8.1.80.0050.00317.44
8.1.70.0030.00317.45
8.1.60.0000.00817.57
8.1.50.0040.00417.49
8.1.40.0060.00617.50
8.1.30.0050.00317.56
8.1.20.0050.00317.65
8.1.10.0030.00617.38
8.1.00.0000.00717.48
8.0.300.0000.00818.77
8.0.290.0060.00316.75
8.0.280.0030.00318.25
8.0.270.0030.00317.11
8.0.260.0060.00017.20
8.0.250.0030.00316.82
8.0.240.0040.00417.00
8.0.230.0000.00716.82
8.0.220.0000.00716.85
8.0.210.0040.00416.86
8.0.200.0090.00016.95
8.0.190.0040.00416.88
8.0.180.0070.00016.90
8.0.170.0000.00716.84
8.0.160.0080.00016.91
8.0.150.0040.00416.76
8.0.140.0070.00316.88
8.0.130.0000.00513.32
8.0.120.0080.00016.94
8.0.110.0040.00416.95
8.0.100.0030.00316.75
8.0.90.0040.00416.95
8.0.80.0070.00716.89
8.0.70.0000.00716.75
8.0.60.0020.00516.71
8.0.50.0000.00816.78
8.0.30.0070.01017.06
8.0.20.0090.01217.40
8.0.10.0050.00217.12
8.0.00.0000.01616.66
7.4.330.0000.00515.10
7.4.320.0060.00016.64
7.4.300.0030.00316.57
7.4.290.0030.00316.54
7.4.280.0050.00316.60
7.4.270.0060.00016.52
7.4.260.0030.00616.59
7.4.250.0050.00316.53
7.4.240.0000.00816.61
7.4.230.0070.00016.57
7.4.220.0090.00916.59
7.4.210.0070.00716.51
7.4.200.0040.00416.67
7.4.160.0080.00816.42
7.4.150.0070.01017.40
7.4.140.0090.00817.86
7.4.130.0090.00916.57
7.4.120.0090.00916.56
7.4.110.0090.01216.46
7.4.100.0110.01116.48
7.4.90.0040.01516.58
7.4.80.0100.00719.39
7.4.70.0150.00616.40
7.4.60.0090.01516.65
7.4.50.0110.00416.56
7.4.40.0070.01016.54
7.4.30.0030.01516.38
7.4.00.0090.00315.10
7.3.330.0080.00013.12
7.3.320.0000.00513.13
7.3.310.0000.00716.31
7.3.300.0000.00716.32
7.3.290.0030.00316.26
7.3.280.0090.00716.35
7.3.270.0030.01317.40
7.3.260.0110.00616.30
7.3.250.0090.01016.34
7.3.240.0050.01616.56
7.3.230.0090.00816.48
7.3.210.0130.01016.33
7.3.200.0070.01016.42
7.3.190.0130.00416.30
7.3.180.0060.01716.57
7.3.170.0140.00316.52
7.3.160.0070.01416.30
7.2.330.0100.00716.61
7.2.320.0030.01516.67
7.2.310.0080.01616.63
7.2.300.0130.00316.35
7.2.290.0060.01016.56
7.2.80.0000.01416.48
7.2.60.0060.00917.07
7.2.50.0050.00816.80
7.1.200.0050.01215.41
7.1.70.0030.00617.27
7.1.60.0140.00319.87
7.1.50.0040.01816.86
7.1.00.0000.08022.54
7.0.200.0390.00014.66
7.0.100.0000.07319.92
7.0.90.0270.07719.84
7.0.80.0170.06719.96
7.0.70.0100.07719.88
7.0.60.0130.04720.04
7.0.50.0030.06020.36
7.0.40.0200.04320.14
7.0.30.0030.04020.13
7.0.20.0100.07320.08
7.0.10.0030.06720.02
7.0.00.0100.06720.14
5.6.280.0030.07021.10
5.6.250.0030.08020.70
5.6.240.0200.06320.48
5.6.230.0030.08020.57
5.6.220.0070.06720.55
5.6.210.0100.03720.63
5.6.200.0000.05721.07
5.6.190.0030.04020.95
5.6.180.0100.07720.98
5.6.170.0070.08320.95
5.6.160.0030.08321.17
5.6.150.0030.04021.05
5.6.140.0100.07320.94
5.6.130.0030.06020.94
5.6.120.0100.08021.07
5.6.110.0030.06721.01
5.6.100.0030.05021.04
5.6.90.0100.07720.98
5.6.80.0100.06320.37
5.6.70.0000.05020.32
5.6.60.0100.07020.38
5.6.50.0070.08020.39
5.6.40.0100.04320.30
5.6.30.0170.06720.39
5.6.20.0000.05320.40
5.6.10.0030.05720.29
5.6.00.0070.04720.34
5.5.380.0030.05020.32
5.5.370.0100.04320.32
5.5.360.0170.06320.52
5.5.350.0100.06720.41
5.5.340.0000.05320.82
5.5.330.0030.07720.92
5.5.320.0070.08020.79
5.5.310.0100.07320.88
5.5.300.0100.07020.77
5.5.290.0030.04020.89
5.5.280.0170.08020.62
5.5.270.0000.08320.63
5.5.260.0130.07720.89
5.5.250.0100.07720.58
5.5.240.0130.07320.11
5.5.230.0200.06320.29
5.5.220.0100.04720.09
5.5.210.0170.06720.17
5.5.200.0070.05720.25
5.5.190.0030.07019.95
5.5.180.0100.07020.07
5.5.160.0100.05720.26
5.5.150.0100.05320.20
5.5.140.0070.05720.13
5.5.130.0070.06320.18
5.5.120.0100.03720.26
5.5.110.0170.06320.20
5.5.100.0030.05020.21
5.5.90.0000.04720.14
5.5.80.0070.03719.94
5.5.70.0170.03720.14
5.5.60.0100.06319.99
5.5.50.0030.08320.15
5.5.40.0030.08320.12
5.5.30.0030.03720.13
5.5.20.0000.07720.08
5.5.10.0000.04320.00
5.5.00.0030.05719.95

preferences:
29.84 ms | 403 KiB | 5 Q