3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Product { private ?int $id; private ?string $name; private function __construct(?int $id = null, ?string $name = null) { $this->id = $id; $this->name = $name; var_dump('yep2'); } public static function fromBasicData(int $id, string $name): static { $new = new static($id, $name); var_dump('yep'); return $new; } } $p1 = Product::fromBasicData(5, 'Widget');

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.3.130.0050.00316.46
8.3.120.0000.00919.09
8.3.110.0030.00620.94
8.3.100.0060.00318.66
8.3.90.0080.00026.77
8.3.80.0030.00618.43
8.3.70.0060.01616.75
8.3.60.0060.01216.75
8.3.50.0030.01718.26
8.3.40.0130.00020.09
8.3.30.0000.01518.46
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.250.0060.00316.66
8.2.240.0110.00418.86
8.2.230.0030.00722.58
8.2.220.0000.00824.06
8.2.210.0150.00026.77
8.2.200.0030.00716.75
8.2.190.0150.00416.58
8.2.180.0130.00325.92
8.2.170.0150.00618.82
8.2.160.0070.01022.96
8.2.150.0070.01025.66
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0050.00326.16
8.2.110.0030.00622.30
8.2.100.0090.00317.78
8.2.90.0080.00017.91
8.2.80.0090.00017.97
8.2.70.0030.00517.80
8.2.60.0000.00718.16
8.2.50.0040.00418.10
8.2.40.0040.00419.16
8.2.30.0000.00717.92
8.2.20.0040.00420.68
8.2.10.0020.00518.00
8.2.00.0040.00419.25
8.1.300.0030.00617.73
8.1.290.0090.00030.84
8.1.280.0110.00725.92
8.1.270.0040.00424.66
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0040.00817.23
8.1.230.0080.00322.75
8.1.220.0000.00817.76
8.1.210.0000.00818.77
8.1.200.0080.00017.36
8.1.190.0050.00317.22
8.1.180.0030.00618.10
8.1.170.0030.00518.65
8.1.160.0000.00718.87
8.1.150.0030.00518.61
8.1.140.0040.00417.27
8.1.130.0000.00717.29
8.1.120.0040.00418.62
8.1.110.0120.00518.64
8.1.100.0170.00018.63
8.1.90.0070.00718.58
8.1.80.0120.00218.51
8.1.70.0080.00818.54
8.1.60.0180.00018.73
8.1.50.0120.00618.79
8.1.40.0120.00618.87
8.1.30.0100.00718.68
8.1.20.0210.00018.82
8.1.10.0120.00618.71
8.1.00.0130.00418.69
8.0.300.0000.00720.14
8.0.290.0110.00016.58
8.0.280.0000.00718.38
8.0.270.0030.00316.74
8.0.260.0030.00316.66
8.0.250.0150.00017.94
8.0.240.0120.00317.88
8.0.230.0100.00517.99
8.0.220.0090.00617.85
8.0.210.0050.00917.98
8.0.200.0140.00017.91
8.0.190.0120.00318.00
8.0.180.0130.00318.01
8.0.170.0050.01018.00
8.0.160.0090.00618.00
8.0.150.0100.00517.94
8.0.140.0160.00017.82
8.0.130.0110.00517.81
8.0.120.0080.00817.97
8.0.110.0070.00717.92
8.0.100.0090.00517.92
8.0.90.0090.00017.98
8.0.80.0090.00017.87
8.0.70.0040.00417.84
8.0.60.0050.00517.86
8.0.50.0040.00917.88
8.0.30.0130.00317.99
8.0.20.0110.00418.07
8.0.10.0140.00017.96
7.4.330.0140.00013.98
7.4.320.0110.00417.43
7.4.300.0130.00317.57
7.4.290.0060.00317.54
7.4.280.0040.00417.10
7.4.270.0060.00317.35
7.4.260.0000.01217.45
7.4.250.0000.00917.21
7.4.240.0060.00317.25
7.4.230.0060.00617.58
7.4.220.0110.00317.43
7.4.210.0090.00017.10
7.4.200.0070.00319.37
7.4.190.0070.00318.81
7.4.180.0110.00017.54
7.4.160.0030.00617.07
7.4.150.0050.00517.42
7.4.140.0030.00916.91
7.4.130.0030.00817.21
7.4.120.0060.00317.57
7.4.110.0090.00017.13
7.4.100.0070.00417.58
7.4.90.0070.00417.30
7.4.80.0050.00517.29
7.4.70.0130.00017.36
7.4.60.0080.00619.18
7.4.50.0040.00819.00
7.4.40.0030.00917.25
7.4.30.0050.00517.02
7.4.20.0070.00317.01
7.4.10.0050.00519.16
7.4.00.0050.00517.37

preferences:
53.09 ms | 403 KiB | 5 Q