3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $ref; function __construct () { $this->ref = new class() { public $name; public function sayName() : string { return $this->name; } }; } public function create (string $name) { $this->ref->name = $name; return clone $this->ref; } } $A = new A(); $testA = $A->create("matti"); $testB = $A->create("Pekka"); var_dump($testA);

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.60.0100.00716.50
8.3.50.0130.00721.21
8.3.40.0100.01018.84
8.3.30.0110.00418.54
8.3.20.0040.00420.21
8.3.10.0000.00821.47
8.3.00.0080.00023.66
8.2.180.0150.00316.38
8.2.170.0170.00318.78
8.2.160.0080.00822.96
8.2.150.0000.00725.66
8.2.140.0040.00424.66
8.2.130.0000.00719.83
8.2.120.0040.00426.35
8.2.110.0090.00020.52
8.2.100.0040.00717.72
8.2.90.0000.00817.75
8.2.80.0040.00418.45
8.2.70.0050.00317.50
8.2.60.0080.00017.50
8.2.50.0000.00917.55
8.2.40.0000.00922.31
8.2.30.0030.00520.61
8.2.20.0050.00217.55
8.2.10.0080.00017.90
8.2.00.0080.00018.04
8.1.280.0090.00625.92
8.1.270.0030.00623.90
8.1.260.0070.00028.09
8.1.250.0040.00428.09
8.1.240.0070.00323.73
8.1.230.0040.00721.04
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0030.00617.36
8.1.190.0050.00517.36
8.1.180.0060.00318.10
8.1.170.0030.00618.49
8.1.160.0040.00420.67
8.1.150.0000.00718.87
8.1.140.0040.00419.56
8.1.130.0030.00317.65
8.1.120.0000.00717.50
8.1.110.0030.00617.45
8.1.100.0080.00017.34
8.1.90.0040.00417.44
8.1.80.0040.00417.34
8.1.70.0000.00717.46
8.1.60.0000.00717.55
8.1.50.0090.00017.56
8.1.40.0050.00317.39
8.1.30.0040.00417.54
8.1.20.0020.00517.50
8.1.10.0000.00717.55
8.1.00.0000.00717.37
8.0.300.0060.00318.77
8.0.290.0070.00016.75
8.0.280.0030.00318.36
8.0.270.0030.00317.26
8.0.260.0030.00317.24
8.0.250.0030.00316.98
8.0.240.0000.00716.91
8.0.230.0070.00016.92
8.0.220.0040.00316.93
8.0.210.0000.00816.82
8.0.200.0060.00316.98
8.0.190.0060.00316.90
8.0.180.0070.00016.94
8.0.170.0040.00416.82
8.0.160.0000.00716.78
8.0.150.0050.00316.80
8.0.140.0040.00716.84
8.0.130.0050.00013.32
8.0.120.0080.00016.73
8.0.110.0000.00716.95
8.0.100.0000.00817.00
8.0.90.0000.00716.94
8.0.80.0130.01016.81
8.0.70.0000.00716.88
8.0.60.0080.00016.75
8.0.50.0050.00216.86
8.0.30.0110.01116.93
8.0.20.0140.00617.40
8.0.10.0040.00416.89
8.0.00.0120.00816.71
7.4.330.0000.00516.78
7.4.320.0030.00316.59
7.4.300.0030.00316.64
7.4.290.0060.00316.50
7.4.280.0060.00316.57
7.4.270.0000.00716.48
7.4.260.0060.00316.57
7.4.250.0080.00016.51
7.4.240.0030.00416.57
7.4.230.0000.00716.30
7.4.220.0120.00816.44
7.4.210.0000.01416.70
7.4.200.0070.00016.53
7.4.150.0090.00917.40
7.4.140.0160.00617.86
7.4.130.0120.00816.49
7.4.120.0130.00916.63
7.4.110.0150.00616.52
7.4.100.0090.01616.60
7.4.90.0100.01016.53
7.4.80.0000.01819.39
7.4.70.0060.01516.50
7.4.60.0040.01116.48
7.4.50.0070.00716.61
7.4.40.0070.01016.30
7.4.30.0040.01716.53
7.4.00.0060.00915.07
7.3.330.0000.00613.33
7.3.320.0050.00013.30
7.3.310.0030.00316.33
7.3.300.0030.00316.17
7.3.290.0090.00716.29
7.3.280.0080.00916.35
7.3.270.0140.00417.40
7.3.260.0080.00916.46
7.3.250.0150.00516.47
7.3.240.0070.01016.36
7.3.230.0070.01016.39
7.3.210.0120.00916.42
7.3.200.0130.01019.39
7.3.190.0130.00316.43
7.3.180.0100.00716.43
7.3.170.0060.01816.31
7.3.160.0100.01016.45
7.2.330.0100.00716.79
7.2.320.0060.01216.75
7.2.310.0110.00616.59
7.2.300.0070.01716.62
7.2.290.0120.00916.76
7.2.60.0120.00316.77
7.2.00.0050.00519.43
7.1.200.0120.00315.68
7.1.100.0060.00618.05
7.1.70.0050.00517.03
7.1.60.0000.01119.20
7.1.50.0000.01416.63
7.1.00.0030.07722.44
7.0.200.0030.00616.86
7.0.60.0070.06721.77
7.0.50.0130.07717.86
7.0.40.0130.08020.13
7.0.30.0070.06020.16
7.0.20.0370.04020.19
7.0.10.0070.04020.07
7.0.00.0100.08020.09
5.6.280.0000.03321.02
5.6.210.0030.08320.55
5.6.200.0000.05718.18
5.6.190.0070.04320.61
5.6.180.0270.04020.46
5.6.170.0200.07320.48
5.6.160.0000.04320.44
5.6.150.0000.04718.22
5.6.140.0070.06018.14
5.6.130.0170.07018.27
5.6.120.0170.07720.99
5.6.110.0100.08020.98
5.6.100.0100.08721.00
5.6.90.0030.08720.99
5.6.80.0030.06320.39
5.5.350.0170.04020.32
5.5.340.0070.07018.04
5.5.330.0170.07320.48
5.5.320.0400.05320.30
5.5.310.0230.05020.29
5.5.300.0030.08718.01
5.5.290.0030.04717.95
5.5.280.0070.08720.98
5.5.270.0100.08320.98
5.5.260.0000.04720.96
5.5.250.0070.08720.69
5.5.240.0100.08320.01

preferences:
64.83 ms | 401 KiB | 5 Q