3v4l.org

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

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.0110.00316.63
8.3.50.0070.00716.46
8.3.40.0120.00318.76
8.3.30.0110.00418.70
8.3.20.0040.00420.22
8.3.10.0040.00421.76
8.3.00.0050.00323.61
8.2.180.0120.00916.63
8.2.170.0060.00918.84
8.2.160.0070.01022.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0110.00719.85
8.2.120.0030.00626.35
8.2.110.0030.00622.26
8.2.100.0060.00618.04
8.2.90.0000.00819.22
8.2.80.0080.00018.00
8.2.70.0030.00717.63
8.2.60.0000.00818.04
8.2.50.0000.00818.07
8.2.40.0080.00022.18
8.2.30.0000.00720.52
8.2.20.0040.00417.67
8.2.10.0000.00718.09
8.2.00.0000.00718.09
8.1.280.0150.00025.92
8.1.270.0060.00323.83
8.1.260.0070.00028.09
8.1.250.0000.00828.09
8.1.240.0090.00023.84
8.1.230.0090.00318.95
8.1.220.0000.00817.79
8.1.210.0040.00418.77
8.1.200.0030.00617.34
8.1.190.0110.00217.13
8.1.180.0060.00318.10
8.1.170.0040.00418.66
8.1.160.0000.00720.73
8.1.150.0080.00018.73
8.1.140.0040.00419.53
8.1.130.0070.00017.65
8.1.120.0040.00417.41
8.1.110.0040.00417.29
8.1.100.0000.00717.39
8.1.90.0080.00017.42
8.1.80.0000.00717.43
8.1.70.0070.00017.46
8.1.60.0000.00717.54
8.1.50.0040.00417.53
8.1.40.0000.00817.46
8.1.30.0030.00617.63
8.1.20.0040.00417.52
8.1.10.0040.00417.52
8.1.00.0040.00417.48
8.0.300.0000.00818.77
8.0.290.0040.00416.75
8.0.280.0000.00718.34
8.0.270.0050.00217.14
8.0.260.0080.00017.22
8.0.250.0000.00716.94
8.0.240.0040.00416.89
8.0.230.0040.00416.92
8.0.220.0040.00416.96
8.0.210.0000.00716.84
8.0.200.0040.00417.02
8.0.190.0060.00616.99
8.0.180.0030.00516.95
8.0.170.0000.00816.95
8.0.160.0070.00017.05
8.0.150.0030.00517.01
8.0.140.0110.00016.86
8.0.130.0050.00013.43
8.0.120.0080.00017.04
8.0.110.0000.00716.96
8.0.100.0070.00017.03
8.0.90.0050.00316.96
8.0.80.0080.00917.03
8.0.70.0050.00216.96
8.0.60.0080.00016.95
8.0.50.0040.00417.03
8.0.30.0110.01017.00
8.0.20.0130.00617.40
8.0.10.0000.00717.08
8.0.00.0100.00816.82
7.4.330.0000.00516.71
7.4.320.0000.00716.48
7.4.300.0000.00816.38
7.4.290.0050.00516.55
7.4.280.0030.00716.54
7.4.270.0000.00716.51
7.4.260.0060.00316.49
7.4.250.0000.00716.52
7.4.240.0030.00516.52
7.4.230.0070.00016.66
7.4.220.0040.01616.66
7.4.210.0100.00716.55
7.4.200.0030.00316.29
7.4.160.0070.01016.23
7.4.150.0160.00317.40
7.4.140.0080.01417.86
7.4.130.0110.00616.41
7.4.120.0100.00816.42
7.4.110.0130.00816.70
7.4.100.0130.00916.52
7.4.90.0120.00616.49
7.4.80.0060.01519.39
7.4.70.0040.01216.53
7.4.60.0070.01016.50
7.4.50.0030.01516.65
7.4.40.0110.00616.67
7.4.30.0130.00716.67
7.4.10.0070.01015.06
7.4.00.0120.00615.14
7.3.330.0000.00613.29
7.3.320.0000.00613.24
7.3.310.0030.00316.16
7.3.300.0050.00216.27
7.3.290.0090.00716.28
7.3.280.0110.00316.33
7.3.270.0120.00617.40
7.3.260.0080.00816.64
7.3.250.0120.00816.36
7.3.240.0150.00316.37
7.3.230.0070.01016.45
7.3.210.0100.00616.38
7.3.200.0100.01119.39
7.3.190.0160.00316.30
7.3.180.0070.01016.11
7.3.170.0100.00716.29
7.3.160.0060.00916.31
7.3.130.0160.00014.80
7.3.120.0140.00414.80
7.3.110.0060.01214.74
7.3.100.0040.01114.84
7.3.90.0060.00914.66
7.3.80.0070.00314.69
7.3.70.0030.01314.76
7.3.60.0050.00814.55
7.3.50.0090.00614.71
7.3.40.0060.00914.66
7.3.30.0070.00714.77
7.3.20.0120.00016.55
7.3.10.0030.01316.60
7.3.00.0100.00716.52
7.2.330.0130.00616.23
7.2.320.0070.01416.64
7.2.310.0130.00316.23
7.2.300.0090.00916.32
7.2.290.0100.00616.39
7.2.260.0060.01014.70
7.2.250.0070.01014.90
7.2.240.0080.00615.05
7.2.230.0040.01115.23
7.2.220.0040.01414.77
7.2.210.0040.01414.89
7.2.200.0000.01414.84
7.2.190.0090.00015.05
7.2.180.0000.01014.77
7.2.170.0070.00714.92
7.2.160.0100.00714.95
7.2.150.0070.00716.50
7.2.140.0060.00916.58
7.2.130.0090.00616.64
7.2.120.0070.01016.79
7.2.110.0060.00316.47
7.2.100.0160.00016.72
7.2.90.0040.00716.55
7.2.80.0030.01017.00
7.2.70.0100.00616.85
7.2.60.0030.01016.85
7.2.50.0130.00316.65
7.2.40.0000.00916.80
7.2.30.0000.01916.83
7.2.20.0030.00616.75
7.2.10.0000.00916.93
7.2.00.0060.00317.94
7.1.330.0030.00915.47
7.1.320.0070.01015.88
7.1.310.0000.01315.37
7.1.300.0080.00615.48
7.1.290.0000.01415.72
7.1.280.0090.00615.64
7.1.270.0060.00315.67
7.1.260.0030.00615.41
7.1.250.0030.00815.73
7.1.240.0030.01015.56
7.1.230.0110.00415.45
7.1.220.0060.00315.75
7.1.210.0030.00715.77
7.1.200.0080.00315.62
7.1.190.0030.01015.72
7.1.180.0030.01015.75
7.1.170.0070.00715.46
7.1.160.0070.00715.44
7.1.150.0030.01015.32
7.1.140.0060.00615.53
7.1.130.0140.00015.82
7.1.120.0060.00915.67
7.1.110.0070.00715.57
7.1.100.0050.00816.85
7.1.90.0000.01315.77
7.1.80.0070.00715.68
7.1.70.0050.00616.39
7.1.60.0050.00917.43
7.1.50.0060.00916.31
7.1.40.0040.01115.89
7.1.30.0030.00615.33
7.1.20.0100.00315.73
7.1.10.0030.01015.46
7.1.00.0060.04019.08
7.0.330.0100.00315.21
7.0.320.0060.00915.34
7.0.310.0040.00815.05
7.0.300.0100.00715.11
7.0.290.0080.00615.36
7.0.280.0070.01015.45
7.0.270.0070.00715.08
7.0.260.0060.00315.22
7.0.250.0060.00615.39
7.0.240.0060.00615.18
7.0.230.0070.00715.16
7.0.220.0030.01015.36
7.0.210.0070.00715.34
7.0.200.0070.00515.80
7.0.190.0030.00915.45
7.0.180.0030.01015.41
7.0.170.0120.00315.49
7.0.160.0030.01015.29
7.0.150.0070.00715.19
7.0.140.0000.01515.23
7.0.130.0070.00715.30
7.0.120.0070.00715.07
7.0.110.0040.00715.44
7.0.100.0070.00715.14
7.0.90.0030.00715.20
7.0.80.0070.01015.35
7.0.70.0040.01115.35
7.0.60.0090.03118.46
7.0.50.0090.04316.58
7.0.40.0070.04717.09
7.0.30.0140.04117.10
7.0.20.0120.03017.00
7.0.10.0060.02516.99
7.0.00.0050.04917.06
5.6.400.0030.00713.92
5.6.390.0000.01414.27
5.6.380.0040.00814.13
5.6.370.0030.01014.25
5.6.360.0030.01014.11
5.6.350.0040.01414.32
5.6.340.0070.01114.40
5.6.330.0030.01013.97
5.6.320.0080.00614.26
5.6.310.0100.00713.92
5.6.300.0040.00414.04
5.6.290.0080.00314.19
5.6.280.0030.02417.55
5.6.270.0040.00814.28
5.6.260.0030.00714.30
5.6.250.0060.00914.17
5.6.240.0070.00714.30
5.6.230.0100.00313.93
5.6.220.0100.00313.95
5.6.210.0130.03617.33
5.6.200.0060.02816.25
5.6.190.0110.04517.34
5.6.180.0150.02617.38
5.6.170.0120.02517.30
5.6.160.0000.02817.32
5.6.150.0120.03816.27
5.6.140.0050.03016.18
5.6.130.0110.04316.18
5.6.120.0070.03217.63
5.6.110.0060.02317.61
5.6.100.0170.03517.48
5.6.90.0070.04517.54
5.6.80.0050.02917.29
5.6.70.0030.01514.13
5.6.60.0070.01013.92
5.6.50.0030.01014.21
5.6.40.0030.01313.92
5.6.30.0080.00813.92
5.6.20.0030.01314.05
5.6.10.0000.01413.92
5.6.00.0090.00613.92
5.5.380.0130.01314.05
5.5.370.0060.01114.15
5.5.360.0100.01513.92
5.5.350.0170.03517.29
5.5.340.0080.02816.12
5.5.330.0100.03617.10
5.5.320.0090.02717.16
5.5.310.0320.02417.08
5.5.300.0100.04316.13
5.5.290.0110.04516.07
5.5.280.0110.04417.40
5.5.270.0110.03217.49
5.5.260.0120.04817.45
5.5.250.0110.04617.32
5.5.240.0130.04517.04
5.5.230.0160.00814.02
5.5.220.0210.00414.05
5.5.210.0120.01213.92
5.5.200.0090.01513.92
5.5.190.0130.01013.92
5.5.180.0150.01013.92
5.5.170.0180.00713.92
5.5.160.0160.01014.25
5.5.150.0090.01713.92
5.5.140.0180.00413.92
5.5.130.0110.01414.07
5.5.120.0090.01213.92
5.5.110.0100.01513.92
5.5.100.0180.00713.92
5.5.90.0200.00514.01
5.5.80.0130.01314.02
5.5.70.0150.01113.92
5.5.60.0070.01414.00
5.5.50.0150.00913.98
5.5.40.0200.00014.09
5.5.30.0140.00914.16
5.5.20.0140.01314.05
5.5.10.0200.00313.95
5.5.00.0130.00813.92

preferences:
55.78 ms | 400 KiB | 5 Q