3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Coalescing { protected $attributes = [ 'attribute1' => 'value1', ]; public function __get($name) { print "GET\n"; if (array_key_exists($name, $this->attributes)) { return $this->attributes[$name]; } trigger_error("Property $name does not exist"); return null; } } $coal = new Coalescing(); var_dump($coal->attribute1 ?? 'default'); //GET //string(6) "value1" var_dump($coal->attribute2 ?? 'default'); //GET // It should dump 'default' here. Instead, the error of __get() is triggered

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.3.60.0150.00818.57
8.3.50.0130.00722.88
8.3.40.0110.00418.84
8.3.30.0070.00718.84
8.3.20.0120.00222.01
8.3.10.0110.00223.55
8.3.00.0060.00919.83
8.2.180.0090.00618.29
8.2.170.0110.00422.96
8.2.160.0150.00319.20
8.2.150.0050.00722.53
8.2.140.0110.00823.42
8.2.130.0040.00724.24
8.2.120.0070.00820.00
8.2.110.0080.00420.20
8.2.100.0080.00518.47
8.2.90.0110.00318.57
8.2.80.0070.00519.06
8.2.70.0070.00518.28
8.2.60.0110.00318.04
8.2.50.0030.00918.45
8.2.40.0080.00618.29
8.2.30.0050.00618.42
8.2.20.0070.00718.12
8.2.10.0070.00818.50
8.2.00.0090.00318.24
8.1.280.0030.01725.92
8.1.270.0060.00523.37
8.1.260.0070.00424.23
8.1.250.0100.00125.17
8.1.240.0090.00320.35
8.1.230.0050.01119.68
8.1.220.0110.00318.39
8.1.210.0090.00518.66
8.1.200.0080.00618.08
8.1.190.0050.00817.91
8.1.180.0090.00618.25
8.1.170.0080.00518.05
8.1.160.0080.00518.61
8.1.150.0050.00618.81
8.1.140.0080.00318.92
8.1.130.0030.00718.07
8.1.120.0080.00317.97
8.1.110.0030.00917.94
8.1.100.0090.00418.02
8.1.90.0070.00617.91
8.1.80.0050.00618.45
8.1.70.0070.00417.88
8.1.60.0090.00218.13
8.1.50.0090.00218.00
8.1.40.0070.00518.16
8.1.30.0090.00318.22
8.1.20.0030.00818.72
8.1.10.0060.00618.11
8.1.00.0070.00318.04
8.0.300.0040.00718.96
8.0.290.0090.00817.17
8.0.280.0110.00617.96
8.0.270.0050.00617.60
8.0.260.0120.00317.48
8.0.250.0100.00617.50
8.0.240.0130.00517.38
8.0.230.0120.00617.46
8.0.220.0070.01017.40
8.0.210.0140.00917.23
8.0.200.0110.00517.32
8.0.190.0180.00417.48
8.0.180.0090.00517.49
8.0.170.0150.00717.43
8.0.160.0080.00517.49
8.0.150.0170.00317.47
8.0.140.0160.00117.39
8.0.130.0130.00715.66
8.0.120.0110.00617.36
8.0.110.0050.00517.38
8.0.100.0100.00517.41
8.0.90.0150.00217.35
8.0.80.0210.00517.37
8.0.70.0090.00517.27
8.0.60.0120.00317.30
8.0.50.0130.00317.26
8.0.30.0090.00817.66
8.0.20.0080.00917.37
8.0.10.0140.00817.20
8.0.00.0060.01317.65
7.4.330.0140.00214.61
7.4.320.0120.00716.95
7.4.300.0140.00417.02
7.4.290.0150.00516.94
7.4.280.0190.00517.05
7.4.270.0160.00817.10
7.4.260.0210.00216.89
7.4.250.0180.00417.04
7.4.240.0150.00716.95
7.4.230.0130.00717.08
7.4.220.0100.00916.88
7.4.210.0170.00716.86
7.4.200.0180.00316.99
7.4.190.0230.01017.28
7.4.180.0270.00017.57
7.4.160.0120.00616.89
7.4.150.0120.00917.01
7.4.140.0110.00817.21
7.4.130.0130.00616.70
7.4.120.0120.00616.64
7.4.110.0160.00616.73
7.4.100.0110.00916.78
7.4.90.0130.00816.62
7.4.80.0100.01117.24
7.4.70.0140.00616.72
7.4.60.0170.00516.66
7.4.50.0110.00816.55
7.4.40.0130.00716.62
7.4.30.0110.00816.62
7.4.20.0090.00816.75
7.4.10.0120.00816.37
7.4.00.0100.01116.07
7.3.330.0150.00415.29
7.3.320.0150.00415.29
7.3.310.0110.00616.77
7.3.300.0100.00517.16
7.3.290.0140.00316.88
7.3.280.0090.00916.51
7.3.270.0160.00516.92
7.3.260.0140.00516.65
7.3.250.0140.00616.59
7.3.240.0100.01016.68
7.3.230.0110.00916.73
7.3.220.0160.00516.66
7.3.210.0100.00916.57
7.3.200.0120.00716.60
7.3.190.0120.00716.54
7.3.180.0090.01116.59
7.3.170.0100.00816.74
7.3.160.0100.01216.64
7.3.150.0140.00716.67
7.3.140.0140.00816.60
7.3.130.0150.00716.18
7.3.120.0110.00816.19
7.3.110.0110.00716.28
7.3.100.0130.00716.17
7.3.90.0120.00516.44
7.3.80.0110.00616.24
7.3.70.0120.00516.32
7.3.60.0110.00616.32
7.3.50.0100.00716.32
7.3.40.0080.00816.33
7.3.30.0090.00816.31
7.3.20.0090.00817.04
7.3.10.0100.00817.03
7.3.00.0090.00816.99
7.2.340.0170.00516.60
7.2.330.0160.00716.54
7.2.320.0130.01016.52
7.2.310.0140.01116.59
7.2.300.0180.01016.64
7.2.290.0170.00716.52
7.2.280.0170.00816.53
7.2.270.0160.01016.57
7.2.260.0170.00616.25
7.2.250.0180.00816.26
7.2.240.0170.00716.29
7.2.230.0140.00916.27
7.2.220.0160.00716.19
7.2.210.0140.00816.25
7.2.200.0130.00916.35
7.2.190.0160.00916.33
7.2.180.0150.00616.44
7.2.170.0140.00716.47
7.2.160.0170.00616.38
7.2.150.0140.00817.17
7.2.140.0150.00917.24
7.2.130.0140.00817.24
7.2.120.0210.00417.24
7.2.110.0190.00717.21
7.2.100.0180.00817.20
7.2.90.0160.00917.13
7.2.80.0140.01017.21
7.2.70.0150.00917.17
7.2.60.0140.00817.09
7.2.50.0170.00717.25
7.2.40.0210.00817.63
7.2.30.0180.00717.26
7.2.20.0170.00817.57
7.2.10.0180.00617.49
7.2.00.0150.00817.61
7.1.330.0140.00816.24
7.1.320.0130.01116.25
7.1.310.0150.00616.15
7.1.300.0150.00816.24
7.1.290.0170.00616.18
7.1.280.0180.00416.14
7.1.270.0130.00916.33
7.1.260.0180.00616.14
7.1.250.0140.00816.07
7.1.240.0170.00716.05
7.1.230.0160.00716.11
7.1.220.0210.00716.04
7.1.210.0140.01116.17
7.1.200.0160.00716.09
7.1.190.0150.00916.20
7.1.180.0210.00716.09
7.1.170.0130.01016.11
7.1.160.0340.00716.11
7.1.150.0270.00616.07
7.1.140.0160.00716.46
7.1.130.0140.01016.41
7.1.120.0160.00716.44
7.1.110.0190.00616.48
7.1.100.0170.00616.74
7.1.90.0210.00816.36
7.1.80.0140.01016.51
7.1.70.0250.00616.46
7.1.60.0150.00917.05
7.1.50.0170.00716.58
7.1.40.0180.00816.42
7.1.30.0210.00516.40
7.1.20.0160.00916.33
7.1.10.0160.00816.43
7.1.00.0150.01817.39
7.0.330.0230.00815.81
7.0.320.0150.00615.85
7.0.310.0170.00615.70
7.0.300.0160.00915.80
7.0.290.0170.00515.72
7.0.280.0140.00815.79
7.0.270.0120.01116.06
7.0.260.0210.00516.10
7.0.250.0190.00616.34
7.0.240.0160.00916.27
7.0.230.0140.00816.20
7.0.220.0140.01016.24
7.0.210.0170.01016.13
7.0.200.0250.00716.01
7.0.190.0140.00916.29
7.0.180.0180.00816.20
7.0.170.0180.00816.32
7.0.160.0170.00416.16
7.0.150.0160.00516.07
7.0.140.0150.01016.23
7.0.130.0140.00816.17
7.0.120.0230.00715.85
7.0.110.0170.00516.46
7.0.100.0200.00616.17
7.0.90.0140.01216.19
7.0.80.0170.00716.16
7.0.70.0160.01816.80
7.0.60.0130.01616.79
7.0.50.0170.01616.81
7.0.40.0170.01616.57
7.0.30.0130.02116.52
7.0.20.0170.01816.19
7.0.10.0200.01316.19
7.0.00.0150.01616.16
5.6.400.0120.01015.42
5.6.390.0150.00815.45
5.6.380.0140.00915.48
5.6.370.0160.00615.47
5.6.360.0160.00915.50
5.6.350.0170.00615.54
5.6.340.0130.01015.54
5.6.330.0150.00915.49
5.6.320.0180.00615.43
5.6.310.0130.01315.61
5.6.300.0170.00715.50
5.6.290.0160.01215.51
5.6.280.0160.02116.34
5.6.270.0170.00815.51
5.6.260.0180.00715.49
5.6.250.0210.00915.49
5.6.240.0160.00615.58
5.6.230.0120.00815.46
5.6.220.0150.02116.44
5.6.210.0150.01816.33
5.6.200.0140.01816.52
5.6.190.0130.01716.53
5.6.180.0160.01716.48
5.6.170.0180.01316.42
5.6.160.0150.01516.48
5.6.150.0140.01716.42
5.6.140.0160.01616.46
5.6.130.0150.01616.46
5.6.120.0180.01716.41
5.6.110.0150.01916.41
5.6.100.0150.01716.41
5.6.90.0160.01616.43
5.6.80.0140.01916.25
5.6.70.0140.01716.37
5.6.60.0100.01916.23
5.6.50.0160.01416.25
5.6.40.0140.01416.25
5.6.30.0170.01816.27
5.6.20.0160.02016.27
5.6.10.0170.01816.25
5.6.00.0140.02016.26
5.5.380.0180.00815.54
5.5.370.0140.01015.52
5.5.360.0170.01816.21
5.5.350.0190.01416.23
5.5.340.0180.01416.25
5.5.330.0150.01816.33
5.5.320.0130.01816.29
5.5.310.0140.01916.34
5.5.300.0150.01616.34
5.5.290.0170.01516.36
5.5.280.0150.01616.32
5.5.270.0150.02416.34
5.5.260.0120.02416.38
5.5.250.0130.02016.36
5.5.240.0180.01616.27
5.5.230.0130.02016.25
5.5.220.0150.01716.28
5.5.210.0190.01516.30
5.5.200.0170.01516.09
5.5.190.0160.02016.19
5.5.180.0160.01816.15
5.5.170.0150.00815.35
5.5.160.0160.01716.16
5.5.150.0150.01816.05
5.5.140.0170.01616.04
5.5.130.0170.01716.10
5.5.120.0160.01616.09
5.5.110.0160.01516.01
5.5.100.0150.01816.17
5.5.90.0130.01716.17
5.5.80.0150.01416.28
5.5.70.0150.01716.16
5.5.60.0130.01716.21
5.5.50.0140.01616.23
5.5.40.0140.01716.13
5.5.30.0150.01616.26
5.5.20.0130.01816.18
5.5.10.0150.01516.13
5.5.00.0180.01416.09

preferences:
32.95 ms | 401 KiB | 5 Q