3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __construct(private Bar $bar, private string $_value = 'foo') {} public function __get(string $name) { return match($name) { 'value' => $this->_value, }; } public function __set(string $name, string $value) { switch ($name) { case 'value': $this->bar->doSomething($this); $this->_value = $value; } } } class Bar { public function doSomething(Foo $foo): void { $oldValue = $foo->value; } } $foo = new Foo(new Bar()); $foo->value = '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.120.0040.00520.82
8.4.110.0050.00422.30
8.4.100.0050.00317.61
8.4.90.0060.01317.97
8.4.80.0100.00918.79
8.4.70.0110.00417.79
8.4.60.0100.01018.68
8.4.50.0100.01118.68
8.4.40.0170.00318.59
8.4.30.0100.00618.77
8.4.20.0040.01119.66
8.4.10.0100.01019.51
8.3.250.0150.00319.24
8.3.240.0140.00516.61
8.3.230.0090.01016.82
8.3.220.0100.00819.18
8.3.210.0110.00718.55
8.3.200.0060.00316.85
8.3.190.0150.00416.88
8.3.180.0040.00617.17
8.3.170.0000.00819.16
8.3.160.0160.00317.25
8.3.150.0100.01019.02
8.3.140.0110.00416.72
8.3.130.0080.00018.29
8.3.120.0060.00618.81
8.3.110.0030.00516.63
8.3.100.0090.00024.06
8.3.90.0080.00026.77
8.3.80.0090.00018.43
8.3.70.0090.00616.75
8.3.60.0120.00316.57
8.3.50.0040.01116.45
8.3.40.0110.00721.43
8.3.30.0150.00720.80
8.2.290.0100.00820.58
8.2.280.0070.00418.53
8.2.270.0120.00617.04
8.2.260.0130.00318.46
8.2.250.0080.00416.67
8.2.240.0090.00617.19
8.2.230.0060.00320.94
8.2.220.0090.00037.54
8.2.210.0050.00326.77
8.2.200.0030.00616.50
8.2.190.0070.01418.01
8.2.180.0070.01116.50
8.2.170.0130.00920.82
8.2.160.0090.01221.76
8.1.330.0100.00818.39
8.1.320.0040.00816.29
8.1.310.0150.00418.45
8.1.300.0090.00616.21
8.1.290.0100.00030.84
8.1.280.0090.00625.92

preferences:
36.37 ms | 403 KiB | 5 Q