3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $closure; public function __construct(callable $closure) { $this->closure = $closure; } public function run1(...$args) { ($this->closure)(...$args); } public function run2(...$args) { $this->closure(...$args); } } $foo = new Foo(function($var){ var_dump($var); }); $foo->run1('bar'); $foo->run2('bar'); $foo->run3('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.0070.00718.55
8.3.50.0030.01018.06
8.3.40.0090.00618.95
8.3.30.0110.00418.73
8.3.20.0040.00420.94
8.3.10.0070.00019.25
8.3.00.0000.00823.54
8.2.180.0040.01118.29
8.2.170.0070.00722.96
8.2.160.0090.00621.96
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0040.00419.75
8.2.120.0000.00726.35
8.2.110.0000.01121.06
8.2.100.0080.00417.91
8.2.90.0050.00317.63
8.2.80.0000.00818.83
8.2.70.0030.00517.93
8.2.60.0040.00417.80
8.2.50.0090.00018.10
8.2.40.0040.00419.21
8.2.30.0000.00719.48
8.2.20.0050.00217.97
8.2.10.0000.00718.12
8.2.00.0030.00719.55
8.1.280.0140.00725.92
8.1.270.0080.00023.89
8.1.260.0070.00026.35
8.1.250.0000.00728.09
8.1.240.0090.00019.45
8.1.230.0090.00320.97
8.1.220.0000.00917.74
8.1.210.0050.00318.77
8.1.200.0030.00617.38
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0080.00018.51
8.1.160.0000.00818.83
8.1.150.0000.00718.78
8.1.140.0060.00317.71
8.1.130.0000.00719.02
8.1.120.0070.00017.45
8.1.110.0000.01017.39
8.1.100.0040.00417.45
8.1.90.0000.00817.38
8.1.80.0050.00217.46
8.1.70.0050.00217.44
8.1.60.0080.00017.57
8.1.50.0000.00817.53
8.1.40.0030.00617.57
8.1.30.0000.00917.66
8.1.20.0040.00417.66
8.1.10.0050.00217.58
8.1.00.0040.00417.41
8.0.300.0070.00018.87
8.0.290.0060.00316.75
8.0.280.0040.00418.26
8.0.270.0080.00017.09
8.0.260.0030.00317.13
8.0.250.0070.00016.99
8.0.240.0030.00316.87
8.0.230.0000.00716.96
8.0.220.0030.00516.79
8.0.210.0030.00316.92
8.0.200.0000.00716.99
8.0.190.0000.00817.08
8.0.180.0000.00716.87
8.0.170.0100.00016.96
8.0.160.0000.00717.04
8.0.150.0070.00316.86
8.0.140.0070.00016.96
8.0.130.0050.00013.38
8.0.120.0000.00816.86
8.0.110.0040.00416.84
8.0.100.0000.00916.96
8.0.90.0040.00416.94
8.0.80.0120.01017.00
8.0.70.0000.00716.99
8.0.60.0000.00716.85
8.0.50.0040.00416.84
8.0.30.0120.00717.06
8.0.20.0080.01117.40
8.0.10.0000.00716.90
8.0.00.0100.00817.07
7.4.330.0050.00015.55
7.4.320.0000.00716.57
7.4.300.0040.00416.66
7.4.290.0000.00716.58
7.4.280.0000.00816.48
7.4.270.0030.00316.49
7.4.260.0030.00316.49
7.4.250.0000.00816.46
7.4.240.0030.00316.37
7.4.230.0000.01016.54
7.4.220.0000.00716.68
7.4.210.0060.00916.55
7.4.200.0000.00716.72
7.4.160.0070.01116.55
7.4.140.0090.00917.86
7.4.130.0070.01016.59
7.4.120.0140.00516.50
7.4.110.0090.00616.52
7.4.100.0060.01016.67
7.4.90.0100.00716.59
7.4.80.0100.01019.39
7.4.70.0130.00516.34
7.4.60.0120.00616.48
7.4.50.0080.00816.31
7.4.40.0120.01116.42
7.4.00.0090.00614.91
7.3.330.0030.00313.23
7.3.320.0000.00613.39
7.3.310.0000.00716.27
7.3.300.0080.00016.23
7.3.290.0040.00416.47
7.3.280.0080.00716.37
7.3.260.0120.01116.48
7.3.240.0120.00716.50
7.3.230.0060.01216.58
7.3.210.0130.00316.40
7.3.200.0110.00616.45
7.3.190.0060.01216.50
7.3.180.0140.00916.49
7.3.170.0080.01316.36
7.3.160.0070.01016.47
7.3.120.0110.00714.58
7.3.110.0070.00714.87
7.3.100.0000.01414.70
7.3.90.0060.00915.04
7.3.80.0060.00314.92
7.3.70.0030.00914.91
7.3.60.0000.01314.95
7.3.50.0030.00914.91
7.3.40.0040.01114.54
7.3.30.0100.00014.77
7.3.20.0070.00716.83
7.3.10.0120.00416.63
7.3.00.0000.00916.63
7.2.330.0030.01516.53
7.2.320.0070.01516.61
7.2.310.0100.01316.60
7.2.300.0110.00616.76
7.2.290.0090.00916.60
7.2.240.0070.00714.87
7.2.230.0030.01415.13
7.2.220.0090.00314.84
7.2.210.0070.00714.99
7.2.200.0040.00714.88
7.2.190.0080.00314.73
7.2.180.0040.00714.95
7.2.170.0040.00814.82
7.2.160.0000.01414.76
7.2.150.0030.01016.96
7.2.140.0070.00717.04
7.2.130.0110.00316.97
7.2.120.0060.00916.77
7.2.110.0000.01516.80
7.2.100.0070.01016.98
7.2.90.0070.00416.84
7.2.80.0120.00316.93
7.2.70.0040.00416.98
7.2.60.0980.01115.78
7.2.50.0840.00815.72
7.2.40.0660.00516.00
7.2.30.0850.00716.20
7.2.20.0720.00716.00
7.2.10.1170.00416.15
7.2.00.0830.00616.12
7.1.330.0000.01415.61
7.1.320.0030.01015.78
7.1.310.0000.01315.84
7.1.300.0030.01015.85
7.1.290.0060.00615.86
7.1.280.0140.00015.85
7.1.270.0060.01015.69
7.1.260.0040.01115.83
7.1.250.0040.00715.80
7.1.200.0030.01015.59
7.1.170.1160.00613.67
7.1.160.1210.01016.75
7.1.150.1670.01117.02
7.1.140.1900.01216.60
7.1.130.1690.01417.03
7.1.120.1500.00616.76
7.1.110.1410.00916.18
7.1.100.2440.01516.09
7.1.90.2180.00916.32
7.1.80.2010.00816.31
7.1.70.1680.01015.46
7.1.60.2160.01133.09
7.1.50.1760.01332.93
7.1.40.1500.01232.63
7.1.30.1840.01332.54
7.1.20.3610.01132.56
7.1.10.2370.01114.75
7.1.00.2360.01014.89

preferences:
67 ms | 401 KiB | 5 Q