3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public array $foo = ['baz' => 10]; public int $bar { get => $this->foo['baz']; set { $this->foo['baz'] = $value; //$this->bar = $value; } } public function __sleep() { return ['foo']; //array_keys(get_object_vars($this)); } } $a = new A; $a->bar = 20; var_dump(unserialize(serialize($a))->bar);

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.4.30.0070.01419.48

preferences:
150.76 ms | 1000 KiB | 7 Q