3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Coalescing { protected $attributes = [ 'attribute1' => 'value1', ]; public function __isset() { 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)
7.2.00.0120.00817.39
7.1.120.0110.00816.77
7.1.110.0570.00916.01
7.1.100.0120.00616.08
7.1.90.0170.00316.26
7.1.80.0090.00915.98
7.1.70.0120.00615.22
7.1.60.0240.00932.92
7.1.50.0270.00632.79
7.1.40.0200.01432.57
7.1.30.0270.01032.48
7.1.20.0230.02432.48
7.1.10.0120.00814.24
7.1.00.0170.00614.50

preferences:
138.68 ms | 1394 KiB | 7 Q