3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $a; public function __construct(int $a) { $this->a = $a; } public function __invoke(int $a) : Bar { return new Bar($a); } } class Bar { private $a; public function __construct(int $a) { $this->a = $a; } } $foo = new Foo(1); $bar = new $foo(2); var_dump($foo); var_dump($bar);

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.0060.01218.30
8.3.50.0110.00417.98
8.3.40.0110.00418.79
8.3.30.0070.00718.54
8.3.20.0050.00319.20
8.3.10.0040.00421.73
8.3.00.0000.00720.56
8.2.180.0110.00718.29
8.2.170.0180.00022.96
8.2.160.0100.01018.93
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0080.00017.91
8.2.120.0080.00026.35
8.2.110.0060.00322.06
8.2.100.0080.00417.78
8.2.90.0030.00517.75
8.2.80.0000.00817.97
8.2.70.0040.00418.04
8.2.60.0000.00718.22
8.2.50.0030.00518.10
8.2.40.0050.00319.17
8.2.30.0000.00719.24
8.2.20.0050.00217.89
8.2.10.0000.00717.90
8.2.00.0040.00417.52
8.1.280.0110.00325.92
8.1.270.0080.00018.50
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0030.00622.14
8.1.230.0070.00417.70
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0090.00017.35
8.1.190.0060.00317.23
8.1.180.0040.00418.10
8.1.170.0040.00418.52
8.1.160.0050.00218.84
8.1.150.0040.00418.87
8.1.140.0000.00822.12
8.1.130.0000.00720.03
8.1.120.0000.00717.29
8.1.110.0050.00217.43
8.1.100.0000.00817.27
8.1.90.0030.00817.41
8.1.80.0070.00017.44
8.1.70.0040.00417.46
8.1.60.0030.00617.54
8.1.50.0030.00617.45
8.1.40.0000.00717.58
8.1.30.0000.00817.64
8.1.20.0040.00417.67
8.1.10.0000.00817.59
8.1.00.0040.00417.40
8.0.300.0050.00318.77
8.0.290.0000.00816.63
8.0.280.0000.00718.33
8.0.270.0040.00417.30
8.0.260.0030.00318.39
8.0.250.0080.00016.91
8.0.240.0000.00716.93
8.0.230.0030.00316.85
8.0.220.0040.00416.82
8.0.210.0040.00316.87
8.0.200.0060.00016.93
8.0.190.0040.00416.78
8.0.180.0040.00416.89
8.0.170.0060.00316.76
8.0.160.0070.00016.87
8.0.150.0000.00716.77
8.0.140.0030.00316.81
8.0.130.0030.00313.30
8.0.120.0070.00016.83
8.0.110.0040.00316.82
8.0.100.0050.00316.86
8.0.90.0050.00316.91
8.0.80.0120.00716.84
8.0.70.0080.00016.86
8.0.60.0000.00716.71
8.0.50.0040.00416.74
8.0.30.0100.00917.06
8.0.20.0080.01117.40
8.0.10.0050.00316.91
8.0.00.0150.00616.84
7.4.330.0030.00315.55
7.4.320.0030.00316.55
7.4.300.0050.00216.58
7.4.290.0000.00716.64
7.4.280.0000.00916.44
7.4.270.0000.00716.49
7.4.260.0000.00816.42
7.4.250.0050.00316.47
7.4.240.0030.00316.41
7.4.230.0030.00316.56
7.4.220.0040.00416.34
7.4.210.0070.00916.55
7.4.200.0030.00316.59
7.4.160.0050.01216.59
7.4.140.0120.01017.86
7.4.130.0040.01316.49
7.4.120.0120.00716.55
7.4.110.0070.01116.59
7.4.100.0210.02216.62
7.4.90.0030.01416.45
7.4.80.0130.00719.39
7.4.70.0110.00716.55
7.4.60.0090.00916.39
7.4.50.0070.00716.13
7.4.40.0000.01716.62
7.4.00.0050.01114.72
7.3.330.0060.00013.30
7.3.320.0000.00613.29
7.3.310.0000.00816.20
7.3.300.0000.00716.33
7.3.290.0000.00716.23
7.3.280.0090.00616.29
7.3.260.0150.00516.50
7.3.240.0080.01216.43
7.3.230.0030.01316.29
7.3.210.0080.00816.57
7.3.200.0130.01016.35
7.3.190.0070.01416.21
7.3.180.0150.00616.57
7.3.170.0090.00916.41
7.3.160.0160.00016.51
7.3.120.0060.01214.89
7.3.110.0060.00614.76
7.3.100.0000.01414.87
7.3.90.0060.00614.77
7.3.80.0070.00714.77
7.3.70.0040.01114.57
7.3.60.0060.00314.37
7.3.50.0040.01114.79
7.3.40.0080.00414.68
7.3.30.0060.00914.84
7.3.20.0070.01016.40
7.3.10.0070.01016.61
7.3.00.0000.01016.64
7.2.330.0220.00416.41
7.2.320.0150.00916.64
7.2.310.0100.00616.63
7.2.300.0100.00716.65
7.2.290.0160.00016.75
7.2.250.0070.01114.79
7.2.240.0040.01114.91
7.2.230.0030.00915.07
7.2.220.0000.01314.99
7.2.210.0000.01715.06
7.2.200.0000.01514.86
7.2.190.0070.00714.89
7.2.180.0040.00714.99
7.2.170.0040.00715.08
7.2.110.0340.00714.56
7.2.100.1330.01314.39
7.2.90.0250.00514.54
7.2.80.0210.00914.47
7.2.70.0350.00714.96
7.2.60.0270.00314.74
7.2.50.0230.00914.96
7.2.40.0380.00314.99
7.2.30.0250.00414.84
7.2.20.0220.01115.13
7.2.10.0200.01015.08
7.2.00.0350.01314.55
7.1.330.0080.00815.71
7.1.320.0070.00715.64
7.1.310.0040.01415.76
7.1.300.0080.00415.84
7.1.290.0030.01315.75
7.1.280.0060.00616.01
7.1.270.0000.01315.84
7.1.260.0130.00015.87
7.1.230.0260.01113.91
7.1.220.0380.00413.75
7.1.210.0310.00013.53
7.1.200.0260.00613.77
7.1.190.0230.00713.91
7.1.180.0200.01113.57
7.1.170.0370.00413.71
7.1.160.0240.00813.80
7.1.150.0370.00013.83
7.1.140.0190.01013.83
7.1.130.0360.00614.07
7.1.120.0300.00013.95
7.1.110.0310.00313.96
7.1.100.0230.00413.79
7.1.90.0200.00613.90
7.1.80.1060.00313.92
7.1.70.0230.00913.97
7.1.60.0440.01031.68
7.1.50.0420.01031.81
7.1.40.0410.01331.75
7.1.30.0350.01231.75
7.1.20.0360.01031.93
7.1.10.0160.01213.98
7.1.00.0350.00613.77
5.6.380.0040.01213.91

preferences:
54.3 ms | 400 KiB | 5 Q