3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $data = 'some data'; } class Bar { private readonly string $data; public function __construct(string $data) { $this->data = $data; } } $foo = new Foo(); $bar = new Bar('some data'); (fn() => $this->data = 'other data')->call($foo); //(fn() => $this->data = 'other data')->call($bar); $foo2 = (fn() => $this->data)->call($foo); //$bar2 = (fn() => $this->data)->call($bar); echo $foo2; //echo $bar2;

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

preferences:
141.03 ms | 1394 KiB | 7 Q