3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected string $dbname; public function __construct(array $appdata) { $this->dbname = 'mydb_' . $appdata['id']; } public function debug(): string { return $this->dbname; } } $appdata = [ 'id' => $_ENV['USER'], ]; $foo = new Foo($appdata); var_dump($foo->debug());

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.0060.00320.84
8.4.110.0150.00522.43
8.4.100.0100.01119.53
8.4.90.0130.00718.65
8.4.80.0050.00417.81
8.4.70.0040.00417.92
8.4.60.0040.00519.05
8.4.50.0120.00817.63
8.4.40.0090.00017.77
8.4.30.0000.00820.72
8.4.20.0210.00017.77
8.4.10.0100.01023.89
8.3.250.0080.01018.65
8.3.240.0130.00517.05
8.3.230.0040.00416.68
8.3.220.0150.00517.08
8.3.210.0120.00716.81
8.3.200.0060.00316.61
8.3.190.0090.00917.16
8.3.180.0140.00516.66
8.3.170.0080.01216.64
8.3.160.0120.00616.75
8.3.150.0160.00317.13
8.3.140.0150.00316.63
8.3.130.0040.00416.78
8.3.120.0060.00318.94
8.3.110.0080.00016.63
8.3.100.0080.00316.78
8.3.90.0030.00526.77
8.3.80.0040.00418.56
8.3.70.0060.01216.58
8.3.60.0100.00618.43
8.3.50.0100.00720.04
8.3.40.0100.00321.98
8.3.30.0120.00318.69
8.3.20.0040.00424.18
8.3.10.0070.00024.66
8.3.00.0070.00026.16
8.2.290.0110.00720.51
8.2.280.0090.00920.34
8.2.270.0110.00716.72
8.2.260.0100.00718.69
8.2.250.0000.00816.75
8.2.240.0080.00017.26
8.2.230.0060.00320.94
8.2.220.0060.00924.06
8.2.210.0050.00326.77
8.2.200.0060.00316.38
8.2.190.0110.00416.61
8.2.180.0030.01425.92
8.2.170.0070.01319.05
8.2.160.0100.00322.96
8.2.150.0070.00025.66
8.2.140.0000.00724.66
8.2.130.0050.00326.16
8.2.120.0050.00319.76
8.2.110.0070.00320.50
8.2.100.0060.00320.35
8.1.330.0070.00522.13
8.1.320.0080.01116.15
8.1.310.0140.00316.55
8.1.300.0030.01516.44
8.1.290.0030.00630.84
8.1.280.0000.01825.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00018.60
8.1.230.0030.00718.73
8.1.80.0050.00317.38

preferences:
26.78 ms | 403 KiB | 5 Q