3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class Thing { public function __construct(public readonly string $something) {} public function withSomething(string $something): self { $instance = clone $this; $instance->something = $something; return $instance; } } $thing = new Thing('hello'); $thing = $thing->withSomething('goodbye');

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.0000.00717.32
8.1.80.0140.00317.39
8.1.70.0160.00017.39
8.1.60.0150.00517.51
8.1.50.0130.00417.52
8.1.40.0110.00717.52
8.1.30.0090.00917.58
8.1.20.0060.01217.47
8.1.10.0090.00917.44
8.1.00.0140.00417.36
8.0.220.0070.00816.89
8.0.210.0100.00516.72
8.0.200.0110.00516.87
8.0.190.0130.00316.76
8.0.180.0120.00316.75
8.0.170.0160.00016.73
8.0.160.0000.01416.78
8.0.150.0110.00416.81
8.0.140.0140.00016.86
8.0.130.0080.00816.75
8.0.120.0150.00016.78
8.0.110.0080.00816.80
8.0.100.0150.00016.77
8.0.90.0100.00716.66
8.0.80.0090.00616.82
8.0.70.0160.00016.78
8.0.60.0120.00516.84
8.0.50.0090.00616.82
8.0.30.0080.00816.83
8.0.20.0090.00416.79
8.0.10.0130.00016.82
7.4.300.0100.00016.28
7.4.290.0030.01216.46
7.4.280.0140.00016.48
7.4.270.0110.00416.32
7.4.260.0110.00216.27
7.4.250.0100.00516.44
7.4.240.0000.01416.43
7.4.230.0090.00416.32
7.4.220.0000.01216.34
7.4.210.0120.00016.41
7.4.200.0060.00616.32
7.4.190.0040.00416.29
7.4.180.0000.00716.12
7.4.160.0040.00415.95
7.4.150.0040.00416.09
7.4.140.0090.00015.73
7.4.130.0090.00015.92
7.4.120.0100.00016.01
7.4.110.0060.00216.18
7.4.100.0040.00516.36
7.4.90.0040.00416.21
7.4.80.0040.00415.71
7.4.70.0040.00416.15
7.4.60.0040.00416.30
7.4.50.0030.00816.14
7.4.40.0080.00316.12
7.4.30.0110.00016.27
7.4.20.0030.00616.14
7.4.10.0000.00815.93
7.4.00.0040.00416.18

preferences:
145.93 ms | 1394 KiB | 7 Q