3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Coalescing { protected $attributes = [ 'attribute1' => 'value1', ]; public function __isset($name) { return array_key_exists($name, $this->attributes); } 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.70.0080.00818.27
8.3.60.0100.01018.31
8.3.50.0090.00918.19
8.3.40.0110.00318.72
8.3.30.0040.01118.89
8.3.20.0000.00720.39
8.3.10.0060.00318.43
8.3.00.0040.00423.48
8.2.190.0100.00716.58
8.2.180.0170.00718.54
8.2.170.0190.00322.96
8.2.160.0080.00822.11
8.2.150.0050.00324.18
8.2.140.0030.00624.66
8.2.130.0080.00020.35
8.2.120.0040.00426.35
8.2.110.0100.00022.30
8.2.100.0120.00017.88
8.2.90.0040.00419.34
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0000.00818.03
8.2.50.0030.00518.16
8.2.40.0000.00720.61
8.2.30.0040.00419.12
8.2.20.0030.00517.97
8.2.10.0040.00417.95
8.2.00.0040.00418.04
8.1.280.0140.00725.92
8.1.270.0040.00423.99
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0040.00422.10
8.1.230.0000.01117.89
8.1.220.0000.00917.74
8.1.210.0090.00018.77
8.1.200.0000.00917.23
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0000.00818.50
8.1.160.0040.00418.77
8.1.150.0040.00420.18
8.1.140.0000.00818.99
8.1.130.0000.00818.81
8.1.120.0000.00717.28
8.1.110.0000.00817.36
8.1.100.0080.00017.43
8.1.90.0060.00317.40
8.1.80.0020.00517.44
8.1.70.0070.00017.28
8.1.60.0040.00417.57
8.1.50.0000.00817.42
8.1.40.0000.00817.52
8.1.30.0000.00817.70
8.1.20.0050.00217.66
8.1.10.0040.00417.46
8.1.00.0040.00417.52
8.0.300.0060.00318.77
8.0.290.0080.00016.63
8.0.280.0030.00318.41
8.0.270.0030.00317.26
8.0.260.0060.00018.89
8.0.250.0000.00816.93
8.0.240.0050.00316.81
8.0.230.0070.00016.72
8.0.220.0000.00916.79
8.0.210.0030.00316.85
8.0.200.0060.00016.80
8.0.190.0080.00016.86
8.0.180.0000.00816.89
8.0.170.0040.00416.78
8.0.160.0060.00316.79
8.0.150.0030.00616.77
8.0.140.0040.00416.76
8.0.130.0050.00513.29
8.0.120.0040.00416.78
8.0.110.0080.00016.64
8.0.100.0000.00716.61
8.0.90.0040.00416.79
8.0.80.0090.00616.88
8.0.70.0040.00416.72
8.0.60.0000.00816.72
8.0.50.0050.00316.85
8.0.30.0080.01117.03
8.0.20.0120.00817.40
8.0.10.0080.00016.91
8.0.00.0070.01116.95
7.4.330.0000.00515.55
7.4.320.0060.00016.51
7.4.300.0030.00316.42
7.4.290.0000.00716.39
7.4.280.0000.00716.45
7.4.270.0060.00016.50
7.4.260.0040.00416.49
7.4.250.0000.00716.39
7.4.240.0000.00716.42
7.4.230.0030.00316.55
7.4.220.0100.01016.56
7.4.210.0050.01116.56
7.4.200.0030.00316.61
7.4.160.0070.00816.48
7.4.150.0160.00717.40
7.4.140.0110.00817.86
7.4.130.0040.01416.50
7.4.120.0110.00816.54
7.4.110.0170.00316.45
7.4.100.0070.01216.52
7.4.90.0070.01016.37
7.4.80.0090.00619.39
7.4.70.0030.01916.56
7.4.60.0120.01216.36
7.4.50.0000.01216.44
7.4.40.0060.01716.42
7.4.30.0060.01216.61
7.4.00.0130.00314.72
7.3.330.0060.00013.17
7.3.320.0000.00613.27
7.3.310.0000.00816.22
7.3.300.0060.00316.27
7.3.290.0040.00416.27
7.3.280.0080.00916.31
7.3.270.0110.00717.40
7.3.260.0130.00616.42
7.3.250.0130.00516.39
7.3.240.0090.00916.49
7.3.230.0100.00716.32
7.3.210.0070.01116.53
7.3.200.0140.00316.37
7.3.190.0110.00516.39
7.3.180.0170.00016.45
7.3.170.0150.00016.40
7.3.160.0120.00316.35
7.3.10.0130.00315.87
7.3.00.0060.00916.25
7.2.330.0040.01616.37
7.2.320.0100.00716.69
7.2.310.0030.01216.77
7.2.300.0090.00916.64
7.2.290.0070.01116.42
7.2.130.0150.00416.58
7.2.120.0110.00416.61
7.2.110.0100.00716.02
7.2.100.0170.00316.14
7.2.90.0040.00716.21
7.2.80.0060.00916.21
7.2.70.0100.01016.73
7.2.60.0060.00816.50
7.2.50.0090.00916.52
7.2.40.0120.00416.31
7.2.30.0110.00916.55
7.2.20.0120.00616.45
7.2.10.0140.00716.73
7.2.00.0130.00817.09
7.1.250.0100.00715.02
7.1.200.0030.01015.85
7.1.120.0130.01017.09
7.1.110.0100.01316.25
7.1.100.0120.00916.26
7.1.90.0120.00616.21
7.1.80.0070.01116.07
7.1.70.0090.00915.45
7.1.60.0190.02533.04
7.1.50.0160.01633.10
7.1.40.0190.01332.48
7.1.30.0770.00632.70
7.1.20.0180.01232.82
7.1.10.0070.01314.77
7.1.00.0120.00414.81

preferences:
58.96 ms | 401 KiB | 5 Q