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(); defined("T_COALESCE") && eval('var_dump($coal->attribute1 ?? "default");'); //GET //string(6) "value1" defined("T_COALESCE") && eval('var_dump($coal->attribute2 ?? "default");'); //GET //PHP Notice: Property attribute2 does not exist in /var/www/html/test.php on line 23 //PHP Stack trace: //PHP 1. {main}() /var/www/html/test.php:0 //PHP 2. Coalescing->__get() /var/www/html/test.php:41 //PHP 3. trigger_error() /var/www/html/test.php:23 ///var/www/html/test.php:41: //string(7) "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.0150.00316.63
8.3.50.0040.01116.34
8.3.40.0120.00618.68
8.3.30.0110.00318.59
8.3.20.0040.00420.39
8.3.10.0050.00321.90
8.3.00.0060.00321.72
8.2.180.0140.00316.50
8.2.170.0090.00622.96
8.2.160.0070.01320.52
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0110.00420.66
8.2.120.0050.00326.35
8.2.110.0030.00619.33
8.2.100.0000.01118.05
8.2.90.0090.00019.17
8.2.80.0000.00817.97
8.2.70.0060.00317.25
8.2.60.0040.00417.93
8.2.50.0000.00818.09
8.2.40.0050.00320.37
8.2.30.0050.00319.56
8.2.20.0040.00417.63
8.2.10.0050.00218.11
8.2.00.0000.00818.22
8.1.280.0130.00725.92
8.1.270.0080.00021.94
8.1.260.0070.00028.09
8.1.250.0050.00328.09
8.1.240.0030.01422.52
8.1.230.0080.00317.83
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0060.00317.25
8.1.190.0030.00617.23
8.1.180.0030.00618.10
8.1.170.0030.00518.38
8.1.160.0070.00020.77
8.1.150.0050.00318.80
8.1.140.0000.00819.58
8.1.130.0030.00317.77
8.1.120.0070.00417.37
8.1.110.0040.00417.45
8.1.100.0040.00417.51
8.1.90.0070.00017.35
8.1.80.0000.00817.36
8.1.70.0030.00317.47
8.1.60.0020.00517.57
8.1.50.0030.00617.58
8.1.40.0050.00317.43
8.1.30.0040.00417.54
8.1.20.0040.00417.60
8.1.10.0070.00017.45
8.1.00.0080.00017.53
8.0.300.0080.00018.77
8.0.290.0040.00416.63
8.0.280.0020.00518.45
8.0.270.0030.00317.26
8.0.260.0000.00617.13
8.0.250.0000.00616.94
8.0.240.0030.00316.92
8.0.230.0050.00217.00
8.0.220.0000.00716.83
8.0.210.0000.00716.91
8.0.200.0070.00016.82
8.0.190.0000.00716.97
8.0.180.0040.00416.89
8.0.170.0040.00416.91
8.0.160.0070.00016.79
8.0.150.0050.00216.84
8.0.140.0000.00816.83
8.0.130.0000.00513.30
8.0.120.0000.00816.77
8.0.110.0000.00816.85
8.0.100.0070.00016.86
8.0.90.0040.00416.96
8.0.80.0090.00616.87
8.0.70.0000.00816.85
8.0.60.0000.00816.93
8.0.50.0040.00416.80
8.0.30.0090.00617.05
8.0.20.0080.01217.40
8.0.10.0080.00016.91
8.0.00.0090.01016.76
7.4.330.0000.00516.82
7.4.320.0000.00616.61
7.4.300.0000.00816.44
7.4.290.0030.00316.52
7.4.280.0000.00816.60
7.4.270.0030.00316.52
7.4.260.0040.00416.64
7.4.250.0000.00716.61
7.4.240.0040.00416.52
7.4.230.0060.00016.59
7.4.220.0140.00516.68
7.4.210.0120.00416.66
7.4.200.0070.00016.50
7.4.160.0160.00316.53
7.4.150.0180.00417.40
7.4.140.0140.00417.86
7.4.130.0100.00716.44
7.4.120.0050.01116.57
7.4.110.0100.00716.66
7.4.100.0110.00716.64
7.4.90.0040.01416.57
7.4.80.0060.01219.39
7.4.70.0120.00916.56
7.4.60.0100.01016.45
7.4.50.0030.01316.54
7.4.40.0090.00616.51
7.4.30.0070.01316.36
7.4.00.0000.01814.94
7.3.330.0040.00213.33
7.3.320.0000.00513.25
7.3.310.0030.00416.19
7.3.300.0070.00016.34
7.3.290.0000.00816.20
7.3.280.0120.00716.33
7.3.270.0180.00717.40
7.3.260.0090.00916.39
7.3.250.0140.00716.44
7.3.240.0060.01116.38
7.3.230.0110.00616.50
7.3.210.0110.00616.63
7.3.200.0120.01019.39
7.3.190.0100.01316.50
7.3.180.0090.00616.31
7.3.170.0070.01016.58
7.3.160.0180.00316.37
7.2.330.0150.00416.51
7.2.320.0120.00916.70
7.2.310.0090.00916.79
7.2.300.0090.01216.74
7.2.290.0160.00016.55
7.2.60.0070.01016.52
7.2.00.0030.00919.63
7.1.200.0040.01115.96
7.1.100.0000.01518.03
7.1.70.0040.00417.02
7.1.60.0030.01319.40
7.1.50.0040.01816.96
7.1.00.0030.07722.51
7.0.200.0470.01314.69
7.0.60.0270.08019.97
7.0.50.0100.08017.86
7.0.40.0130.08019.96
7.0.30.0200.03720.09
7.0.20.0370.07320.09
7.0.10.0070.05720.04
7.0.00.0130.08720.10
5.6.280.0030.03320.79
5.6.210.0100.08020.75
5.6.200.0030.04018.21
5.6.190.0070.06320.55
5.6.180.0270.04320.51
5.6.170.0270.04720.45
5.6.160.0070.08320.55
5.6.150.0030.04018.23
5.6.140.0030.06318.18
5.6.130.0000.08718.19
5.6.120.0070.05020.97
5.6.110.0200.07721.10
5.6.100.0000.07320.98
5.6.90.0100.07721.11
5.6.80.0100.05020.39
5.5.350.0130.03020.45
5.5.340.0070.04017.98
5.5.330.0070.05320.38
5.5.320.0570.06720.24
5.5.310.0230.08320.34
5.5.300.0000.08018.10
5.5.290.0100.06318.01
5.5.280.0000.04720.88
5.5.270.0030.09020.90
5.5.260.0230.07320.62
5.5.250.0130.07020.59
5.5.240.3170.02320.17

preferences:
65.17 ms | 400 KiB | 5 Q