3v4l.org

run code in 500+ PHP versions simultaneously
<?php final class DemoFile { private readonly string $method; public static function create(int $a): static { $self = new static(); $self->method = 'hi'; if ($a > 0) { $self->method = 'hello'; } return $self; } } $demo = DemoFile::create(2); var_dump($demo);

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.5.30.0090.00821.12
8.5.20.0100.00818.07
8.5.10.0110.00619.54
8.5.00.0100.01220.45
8.4.180.0120.01019.65
8.4.170.0090.01224.02
8.4.160.0130.00923.75
8.4.150.0070.00516.95
8.4.140.0130.01317.69
8.4.130.0110.01017.82
8.4.120.0110.00920.66
8.4.110.0070.00622.35
8.4.100.0140.00718.14
8.4.90.0150.00618.77
8.4.80.0090.01117.96
8.4.70.0120.00818.02
8.4.60.0090.00118.82
8.4.50.0120.00719.63
8.4.40.0030.01718.00
8.4.30.0000.00919.59
8.4.20.0030.00619.64
8.3.300.0100.01020.82
8.3.290.0140.00718.76
8.3.280.0040.00720.19
8.3.270.0090.01116.70
8.3.260.0110.00916.48
8.3.250.0080.00918.82
8.3.240.0110.00716.52
8.3.230.0120.00716.59
8.3.220.0140.00517.41
8.3.210.0110.00516.74
8.3.200.0040.00516.48
8.3.190.0090.01016.97
8.3.180.0080.00716.75
8.3.170.0080.00018.96
8.3.160.0070.01018.45
8.3.150.0060.01218.64
8.3.50.0120.00318.68
8.2.300.0100.01018.25
8.2.290.0130.00520.16
8.2.280.0050.00318.55
8.2.270.0100.01018.39
8.2.70.0090.00479.33
8.1.340.0080.01317.81
8.1.330.0110.00723.98
8.1.320.0110.00816.33

preferences:
60.19 ms | 688 KiB | 5 Q