3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $ref; function __construct () { $this->ref = new class() { public $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); var_dump($testB);

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.0120.00316.50
8.3.50.0080.01121.17
8.3.40.0040.01418.49
8.3.30.0070.00718.71
8.3.20.0040.00420.34
8.3.10.0000.00821.66
8.3.00.0060.00323.58
8.2.180.0120.00618.11
8.2.170.0100.00718.79
8.2.160.0040.01122.96
8.2.150.0070.00025.66
8.2.140.0040.00424.66
8.2.130.0080.00019.64
8.2.120.0040.00426.35
8.2.110.0070.00322.25
8.2.100.0090.00318.04
8.2.90.0000.00919.22
8.2.80.0000.00918.03
8.2.70.0030.00517.63
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0030.00620.33
8.2.30.0040.00420.55
8.2.20.0050.00217.65
8.2.10.0050.00318.12
8.2.00.0070.00018.12
8.1.280.0090.00625.92
8.1.270.0030.00623.78
8.1.260.0050.00328.09
8.1.250.0090.00028.09
8.1.240.0080.00422.24
8.1.230.0110.00019.01
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0070.00417.25
8.1.190.0040.00717.35
8.1.180.0040.00418.10
8.1.170.0000.00818.51
8.1.160.0040.00420.78
8.1.150.0040.00418.89
8.1.140.0030.00519.63
8.1.130.0040.00417.71
8.1.120.0030.00517.46
8.1.110.0000.00717.35
8.1.100.0000.00817.42
8.1.90.0040.00417.46
8.1.80.0000.00717.39
8.1.70.0000.00717.45
8.1.60.0000.00817.50
8.1.50.0040.00417.46
8.1.40.0040.00417.45
8.1.30.0030.00617.50
8.1.20.0040.00417.61
8.1.10.0030.00517.50
8.1.00.0050.00317.45
8.0.300.0080.00018.77
8.0.290.0070.00016.63
8.0.280.0030.00318.32
8.0.270.0040.00417.17
8.0.260.0030.00317.24
8.0.250.0040.00416.96
8.0.240.0040.00416.90
8.0.230.0070.00016.83
8.0.220.0000.00716.93
8.0.210.0030.00316.81
8.0.200.0080.00016.89
8.0.190.0070.00416.83
8.0.180.0040.00416.97
8.0.170.0050.00316.98
8.0.160.0070.00016.79
8.0.150.0070.00016.82
8.0.140.0030.00616.81
8.0.130.0000.00613.28
8.0.120.0050.00316.91
8.0.110.0040.00416.88
8.0.100.0040.00416.73
8.0.90.0030.00516.94
8.0.80.0090.00616.90
8.0.70.0030.00516.94
8.0.60.0000.00716.95
8.0.50.0040.00416.87
8.0.30.0070.01217.24
8.0.20.0110.01017.40
8.0.10.0040.00417.08
8.0.00.0050.01316.82
7.4.330.0050.00016.67
7.4.320.0060.00016.60
7.4.300.0040.00416.50
7.4.290.0090.00016.63
7.4.280.0080.00316.59
7.4.270.0030.00316.51
7.4.260.0000.00816.52
7.4.250.0030.00616.46
7.4.240.0030.00516.51
7.4.230.0000.00816.40
7.4.220.0030.01616.47
7.4.210.0060.00716.55
7.4.200.0070.00016.59
7.4.160.0110.00616.61
7.4.150.0140.01117.40
7.4.140.0100.01217.86
7.4.130.0060.01116.52
7.4.120.0090.01416.64
7.4.110.0170.00316.56
7.4.100.0120.00616.50
7.4.90.0030.01416.54
7.4.80.0060.01219.39
7.4.70.0120.00816.55
7.4.60.0150.00416.48
7.4.50.0070.01016.55
7.4.40.0030.01316.41
7.4.30.0170.00016.67
7.4.00.0120.00314.69
7.3.330.0000.00513.09
7.3.320.0000.00513.10
7.3.310.0030.00316.23
7.3.300.0030.00316.31
7.3.290.0040.01116.32
7.3.280.0070.00916.35
7.3.270.0070.01417.40
7.3.260.0130.01016.30
7.3.250.0120.00816.38
7.3.240.0110.00916.45
7.3.230.0130.01016.59
7.3.210.0070.01016.58
7.3.200.0060.01619.39
7.3.190.0110.00616.32
7.3.180.0060.00916.47
7.3.170.0030.01316.27
7.3.160.0080.01116.38
7.3.10.0070.00716.78
7.3.00.0000.01116.68
7.2.330.0070.01016.60
7.2.320.0090.00916.65
7.2.310.0070.01116.73
7.2.300.0130.00716.38
7.2.290.0060.01216.88
7.2.130.0000.00917.04
7.2.120.0030.01016.92
7.2.110.0030.01316.84
7.2.100.0060.00616.85
7.2.90.0000.01116.80
7.2.80.0080.00317.05
7.2.70.0090.00317.15
7.2.60.0080.00517.02
7.2.50.0140.00016.96
7.2.40.0070.00316.86
7.2.30.0110.00417.21
7.2.20.0040.00717.13
7.2.10.0100.00316.96
7.2.00.0060.00618.07
7.1.250.0030.00715.83
7.1.200.0040.00715.74
7.1.100.0100.00317.90
7.1.70.0080.00817.04
7.1.60.0060.00619.20
7.1.50.0110.01116.99
7.1.00.0030.07722.42
7.0.200.0000.01116.73
7.0.60.0200.04020.07
7.0.50.0170.05717.88
7.0.40.0000.05720.20
7.0.30.0200.06720.09
7.0.20.0230.05020.24
7.0.10.0100.03720.11
7.0.00.0030.05020.10
5.6.280.0030.04021.10
5.6.210.0100.07720.50
5.6.200.0030.09018.23
5.6.190.0100.04720.41
5.6.180.0270.04020.46
5.6.170.0230.08020.50
5.6.160.0000.04320.43
5.6.150.0030.04718.29
5.6.140.0100.08018.24
5.6.130.0000.04718.13
5.6.120.0130.07720.99
5.6.110.0030.04021.02
5.6.100.0030.04321.14
5.6.90.0070.09020.93
5.6.80.0170.05320.41
5.5.350.0330.07320.38
5.5.340.0070.04717.99
5.5.330.0130.06720.21
5.5.320.0100.05020.35
5.5.310.0170.04720.34
5.5.300.0100.04317.94
5.5.290.0000.05317.94
5.5.280.0100.06720.65
5.5.270.0070.04320.76
5.5.260.0130.08020.77
5.5.250.0070.07020.50
5.5.240.0200.04720.26

preferences:
84.68 ms | 401 KiB | 5 Q