3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private File $file { get => $this->file ??= new File($this->test1 . '-' . $this->test2 . '-' . random_int(0, PHP_INT_MAX)); } public function __construct( public string $test1, public string $test2, ) { } public function doStuffA() { var_dump($this->file->file . ' ~ A'); } public function doStuffB() { var_dump($this->file->file . ' ~ B'); } } class File { public function __construct( public string $file, ) { } } $t = new Test('a', 'b'); $t->doStuffA(); $t->doStuffB(); $t->doStuffA(); $t->doStuffB();

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.50.0050.00518.54
8.4.40.0190.00717.87
8.4.30.0170.00518.45
8.4.20.0180.00418.36
8.4.10.0160.00617.47
8.3.190.0180.00216.33
8.3.180.0110.00517.40
8.3.170.0160.00417.21
8.3.160.0190.00316.55
8.3.150.0160.00416.59
8.3.140.0170.00416.63
8.3.130.0130.00616.41
8.3.120.0160.00416.63
8.3.110.0140.00416.53
8.3.100.0160.00516.32
8.3.90.0180.00416.31
8.3.80.0170.00416.47
8.3.70.0180.00417.68
8.3.60.0170.00516.49
8.3.50.0190.00316.38
8.3.40.0160.00417.36
8.3.30.0200.00817.42
8.3.20.0210.00617.38
8.3.10.0160.00517.38
8.3.00.0160.00619.30
8.2.280.0160.00416.26
8.2.270.0200.00316.58
8.2.260.0140.00617.45
8.2.250.0160.00416.49
8.2.240.0140.00416.29
8.2.230.0140.00416.37
8.2.220.0140.00416.48
8.2.210.0150.00416.46
8.2.200.0170.00316.42
8.2.190.0180.00516.63
8.2.180.0180.00416.74
8.2.170.0260.00617.56
8.2.160.0240.00517.38
8.2.150.0200.00717.41
8.2.140.0150.00617.34
8.2.130.0210.00317.48
8.2.120.0160.00817.52
8.2.110.0150.00518.21
8.2.100.0160.00518.11
8.2.90.0110.00618.30
8.2.80.0110.00418.17
8.2.70.0120.00318.26
8.2.60.0120.00218.35
8.2.50.0110.00518.21
8.2.40.0110.00418.17
8.2.30.0090.00518.37
8.2.20.0080.00618.13
8.2.10.0100.00418.28
8.2.00.0110.00518.15
8.1.320.0090.00517.02

preferences:
136.53 ms | 957 KiB | 7 Q