3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A {} class B {} class X { private function create(string $class): object { return new $class(); } public function createA(): A { return $this->create('A'); } public function createB(): B { return $this->create('B'); } } $test = new X; $new = $test->createB(); var_export($new);

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.0130.00419.58
8.5.20.0110.00720.14
8.5.10.0090.00720.21
8.5.00.0100.01220.04
8.4.180.0130.00925.65
8.4.170.0090.01223.87
8.4.160.0140.00723.91
8.4.150.0090.00316.83
8.4.140.0110.01117.40
8.4.130.0140.00718.02
8.4.120.0130.00720.45
8.4.110.0020.00818.82
8.4.100.0120.00817.82
8.4.90.0110.00918.71
8.4.80.0070.01017.86
8.4.70.0060.00417.91
8.4.60.0110.00918.85
8.4.50.0090.01118.64
8.4.40.0040.00417.61
8.4.30.0130.00620.47
8.4.20.0130.00723.89
8.4.10.0060.00323.70
8.3.300.0120.00724.49
8.3.290.0120.01118.12
8.3.280.0110.00918.19
8.3.270.0100.00916.33
8.3.260.0110.00916.70
8.3.250.0100.00818.67
8.3.240.0080.00216.32
8.3.230.0110.00716.80
8.3.220.0050.01118.81
8.3.210.0080.01018.44
8.3.200.0040.00516.36
8.3.190.0130.00516.76
8.3.180.0080.00716.43
8.3.170.0040.01517.21
8.3.160.0110.00418.62
8.3.150.0060.00316.55
8.3.140.0090.00916.63
8.3.130.0090.00016.45
8.3.120.0080.00020.70
8.3.110.0040.00416.59
8.3.100.0070.00316.79
8.3.90.0050.00326.77
8.3.80.0090.00017.97
8.3.70.0060.00916.25
8.3.60.0150.00416.38
8.3.50.0210.00018.23
8.3.40.0140.00020.17
8.3.30.0110.00418.58
8.3.20.0000.00824.18
8.3.10.0000.00724.66
8.3.00.0000.00726.16
8.2.300.0120.01018.05
8.2.290.0120.00720.48
8.2.280.0110.00818.67
8.2.270.0070.01117.05
8.2.260.0110.00416.79
8.2.250.0080.00018.37
8.2.240.0040.01217.40
8.2.230.0080.00020.94
8.2.220.0060.00324.06
8.2.210.0070.00726.77
8.2.200.0070.00316.50
8.2.190.0110.00416.75
8.2.180.0110.00718.54
8.2.170.0120.00318.78
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0040.00722.25
8.2.100.0000.01117.91
8.2.90.0030.00617.75
8.2.80.0090.00017.97
8.2.70.0040.00417.93
8.2.60.0030.00517.63
8.2.50.0030.00517.63
8.2.40.0130.00417.62
8.2.30.0100.00717.62
8.2.20.0140.00317.62
8.2.10.0130.00717.62
8.2.00.0090.00917.62
8.1.340.0080.01018.24
8.1.330.0100.00921.86
8.1.320.0030.00516.07
8.1.310.0110.00418.29
8.1.300.0160.00318.14
8.1.290.0090.00030.84
8.1.280.0100.00725.92
8.1.270.0040.00424.66
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0060.00322.19
8.1.230.0080.00319.15
8.1.220.0000.00717.78
8.1.210.0000.00818.77
8.1.200.0080.00017.22
8.1.190.0000.00817.13
8.1.180.0060.00318.10
8.1.170.0120.00417.62
8.1.160.0160.00017.62
8.1.150.0170.00017.62
8.1.140.0100.00717.62
8.1.130.0100.00717.62
8.1.120.0030.01317.62
8.1.110.0130.00417.62
8.1.100.0130.00417.62
8.1.90.0150.00517.62
8.1.80.0090.00617.62
8.1.70.0110.00517.62
8.1.60.0100.00717.62
8.1.50.0190.00017.62
8.1.40.0150.00517.62
8.1.30.0120.00617.62
8.1.20.0140.00317.62
8.1.10.0150.00317.62
8.1.00.0110.00617.62
8.0.300.0040.00421.52
8.0.290.0000.00816.58
8.0.280.0100.00717.62
8.0.270.0150.00217.62
8.0.260.0130.00417.62
8.0.250.0080.00817.62
8.0.240.0110.00517.62
8.0.230.0070.00917.62
8.0.220.0090.00617.62
8.0.210.0100.00517.62
8.0.200.0120.00317.62
8.0.190.0120.00617.62
8.0.180.0100.00617.62
8.0.170.0160.00017.62
8.0.160.0090.00917.62
8.0.150.0140.00317.62
8.0.140.0150.00017.62
8.0.130.0130.00317.62
8.0.120.0090.00917.62
8.0.110.0170.00017.62
8.0.100.0130.00317.62
8.0.90.0130.00317.62
8.0.80.0090.00617.62
8.0.70.0130.00317.62
8.0.60.0100.00617.62
8.0.50.0160.00317.62
8.0.30.0150.00317.62
8.0.20.0120.00417.62
8.0.10.0120.00317.62

preferences:
45.41 ms | 1100 KiB | 5 Q