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; } public function __isset($name) { print "ISSET\n"; return array_key_exists($name, $this->attributes); } } $coal = new Coalescing(); var_dump($coal->attribute1 ?? 'default'); //GET //string(6) "value1" var_dump($coal->attribute2 ?? 'default');

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.0140.00718.46
8.3.50.0120.01022.88
8.3.40.0160.00318.41
8.3.30.0040.01118.84
8.3.20.0050.00320.28
8.3.10.0040.00421.67
8.3.00.0040.00419.19
8.2.180.0110.00816.32
8.2.170.0090.00622.96
8.2.160.0100.00319.20
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0030.00621.04
8.2.110.0030.00721.18
8.2.100.0090.00317.91
8.2.90.0040.00419.19
8.2.80.0030.00617.97
8.2.70.0080.00017.63
8.2.60.0040.00419.14
8.2.50.0050.00318.10
8.2.40.0070.00020.50
8.2.30.0000.00719.13
8.2.20.0000.00717.67
8.2.10.0070.00018.06
8.2.00.0030.00617.96
8.1.280.0120.00325.92
8.1.270.0030.00624.02
8.1.260.0000.00926.35
8.1.250.0050.00328.09
8.1.240.0050.00322.52
8.1.230.0080.00420.78
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0000.00917.22
8.1.190.0040.00417.23
8.1.180.0030.00618.10
8.1.170.0030.00618.53
8.1.160.0040.00418.98
8.1.150.0000.00718.88
8.1.140.0050.00319.52
8.1.130.0000.00717.64
8.1.120.0000.00717.38
8.1.110.0040.00417.30
8.1.100.0040.00417.29
8.1.90.0000.00717.36
8.1.80.0040.00417.25
8.1.70.0000.00717.28
8.1.60.0040.00417.59
8.1.50.0050.00317.52
8.1.40.0000.00817.41
8.1.30.0050.00317.64
8.1.20.0040.00417.63
8.1.10.0000.00717.46
8.1.00.0020.00517.56
8.0.300.0040.00419.89
8.0.290.0040.00416.62
8.0.280.0000.00718.46
8.0.270.0030.00317.32
8.0.260.0000.00617.26
8.0.250.0080.00016.89
8.0.240.0030.00316.76
8.0.230.0000.00916.93
8.0.220.0030.00316.77
8.0.210.0030.00316.84
8.0.200.0030.00316.78
8.0.190.0050.00316.79
8.0.180.0000.00716.89
8.0.170.0080.00016.81
8.0.160.0030.00516.69
8.0.150.0000.00816.79
8.0.140.0030.00416.70
8.0.130.0000.00613.25
8.0.120.0040.00416.80
8.0.110.0020.00516.66
8.0.100.0080.00016.67
8.0.90.0070.00016.88
8.0.80.0060.00916.72
8.0.70.0030.00616.79
8.0.60.0040.00416.90
8.0.50.0070.00016.84
8.0.30.0130.00917.11
8.0.20.0110.00917.42
8.0.10.0070.00016.78
8.0.00.0180.00316.83
7.4.330.0040.00215.08
7.4.320.0030.00316.61
7.4.300.0060.00016.48
7.4.290.0030.00316.47
7.4.280.0030.00316.48
7.4.270.0030.00316.50
7.4.260.0000.00716.53
7.4.250.0000.00716.57
7.4.240.0010.00616.42
7.4.230.0050.00316.54
7.4.220.0000.01816.49
7.4.210.0060.00816.57
7.4.200.0050.00316.63
7.4.160.0030.01316.43
7.4.150.0040.01417.40
7.4.140.0080.00917.86
7.4.130.0020.01516.53
7.4.120.0090.01116.44
7.4.110.0060.01016.56
7.4.100.0080.00916.30
7.4.90.0110.00716.63
7.4.80.0040.01619.39
7.4.70.0000.01716.34
7.4.60.0110.01016.49
7.4.50.0070.00716.42
7.4.40.0120.00916.44
7.4.30.0120.00916.33
7.4.00.0070.00714.98
7.3.330.0050.00013.32
7.3.320.0030.00313.32
7.3.310.0000.00716.31
7.3.300.0030.00316.29
7.3.290.0100.00316.32
7.3.280.0090.00816.32
7.3.270.0030.01517.40
7.3.260.0080.00816.43
7.3.250.0100.00716.40
7.3.240.0110.01116.42
7.3.230.0100.00716.63
7.3.210.0110.00716.55
7.3.200.0110.00516.30
7.3.190.0140.00316.44
7.3.180.0060.00916.62
7.3.170.0060.00916.52
7.3.160.0080.00916.47
7.2.330.0090.00916.52
7.2.320.0100.01116.77
7.2.310.0120.00616.53
7.2.300.0060.01116.60
7.2.290.0090.00916.68
7.2.60.0060.00616.69
7.2.00.0060.00619.41
7.1.200.0090.00315.60
7.1.70.0000.00817.14
7.1.60.0050.01317.05
7.1.50.0070.00316.62
7.1.00.0030.07722.41
7.0.200.0000.01116.82
7.0.70.0200.06320.05
7.0.60.0200.07720.05
7.0.50.0270.05320.37
7.0.40.0130.06020.31
7.0.30.0300.07320.35
7.0.20.0100.06720.44
7.0.10.0270.05020.31
7.0.00.0270.05320.33
5.6.280.0130.06321.03
5.6.220.0200.05720.73
5.6.210.0200.05720.70
5.6.200.0270.05021.09
5.6.190.0270.06321.08
5.6.180.0130.06721.15
5.6.170.0330.04321.11
5.6.160.0230.05321.05
5.6.150.0200.05721.15
5.6.140.0130.06321.11
5.6.130.0170.06321.18
5.6.120.0230.05721.20
5.6.110.0200.06321.02
5.6.100.0200.06021.09
5.6.90.0200.06021.05
5.6.80.0330.05320.48
5.6.70.0170.06020.45
5.6.60.0230.05320.46
5.6.50.0300.04720.45
5.6.40.0330.04020.46
5.6.30.0270.07320.47
5.6.20.0170.06020.45
5.6.10.0130.06320.48
5.6.00.0300.04720.45
5.5.360.0100.06720.46
5.5.350.0130.06320.48
5.5.340.0200.05320.85
5.5.330.0230.05720.89
5.5.320.0300.05320.98
5.5.310.0270.04720.84
5.5.300.0130.06020.93
5.5.290.0170.06320.84
5.5.280.0200.05720.92
5.5.270.0330.07020.95
5.5.260.0300.04720.91
5.5.250.0170.07320.78
5.5.240.0200.06720.25
5.5.230.0200.07720.25
5.5.220.0170.05320.28
5.5.210.0100.06020.38
5.5.200.0230.06720.33
5.5.190.0100.06720.05
5.5.180.0230.05020.29
5.5.160.0230.05020.25
5.5.150.0200.05720.28
5.5.140.0330.04720.12
5.5.130.0070.06320.30
5.5.120.0200.05020.30
5.5.110.0170.05320.30
5.5.100.0130.06020.12
5.5.90.0100.06320.24
5.5.80.0200.05320.02
5.5.70.0170.05720.17
5.5.60.0170.06020.01
5.5.50.0170.05720.15
5.5.40.0230.05020.07
5.5.30.0170.06020.11
5.5.20.0200.05320.13
5.5.10.0300.04320.07
5.5.00.0170.05720.06

preferences:
58.3 ms | 401 KiB | 5 Q