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.4.130.0080.00818.67
8.4.120.0120.01024.04
8.4.110.0130.00718.83
8.4.100.0110.00918.69
8.4.90.0100.01120.53
8.4.80.0050.00418.81
8.4.70.0080.00118.95
8.4.60.0120.00918.79
8.4.50.0100.01020.32
8.4.40.0150.00318.85
8.4.30.0100.01020.35
8.4.20.0100.01019.82
8.4.10.0160.00319.54
8.3.260.0110.00816.73
8.3.250.0110.00818.80
8.3.240.0060.00217.11
8.3.230.0130.00616.52
8.3.220.0100.00519.17
8.3.210.0100.00818.54
8.3.200.0050.00416.62
8.3.190.0110.00517.24
8.3.180.0100.00916.48
8.3.170.0090.00917.17
8.3.160.0100.00718.42
8.3.150.0060.01318.20
8.3.140.0040.00416.76
8.3.130.0070.00716.68
8.3.120.0000.00816.62
8.3.50.0050.00316.55
8.2.290.0140.00520.38
8.2.280.0130.00918.32
8.2.270.0120.00617.42
8.2.260.0040.01116.42
8.2.250.0090.00018.30
8.1.330.0060.00322.05
8.1.320.0080.01016.25
8.1.310.0050.00318.64
8.1.90.0030.00417.46

preferences:
27.33 ms | 403 KiB | 5 Q