3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Methods { public function doSomething(){ echo 'Did something'; } } class Router { public $methods; public function __construct($methods){ $this->methods = $methods; } public function execute($fn){ return call_user_func($fn->bindTo($this)); } } $router = new Router(new Methods); $router->execute(function(){ echo 'Running the closure'; $this->methods->doSomething(); });

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.00716.25
8.3.50.0070.00716.25
8.3.40.0110.00318.71
8.3.30.0110.00418.59
8.3.20.0070.00021.86
8.3.10.0040.00423.52
8.3.00.0030.00518.00
8.2.180.0140.00718.17
8.2.170.0120.00322.96
8.2.160.0070.01320.47
8.2.150.0050.00324.18
8.2.140.0130.00924.66
8.2.130.0070.00020.46
8.2.120.0000.00726.35
8.2.110.0030.00620.47
8.2.100.0060.00617.62
8.2.90.0050.00319.27
8.2.80.0060.00317.97
8.2.70.0050.00317.25
8.2.60.0000.00818.04
8.2.50.0040.00418.10
8.2.40.0030.00520.45
8.2.30.0000.00721.03
8.2.20.0040.00418.05
8.2.10.0040.00418.07
8.2.00.0040.00418.10
8.1.280.0150.00625.92
8.1.270.0080.00018.87
8.1.260.0040.00426.35
8.1.250.0020.00528.09
8.1.240.0090.00320.89
8.1.230.0080.00319.10
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0000.01017.38
8.1.190.0000.00817.11
8.1.180.0040.00418.10
8.1.170.0000.00818.59
8.1.160.0000.00719.10
8.1.150.0080.00020.64
8.1.140.0040.00419.52
8.1.130.0030.00320.65
8.1.120.0070.00017.52
8.1.110.0050.00317.36
8.1.100.0050.00217.34
8.1.90.0000.00817.37
8.1.80.0000.00717.47
8.1.70.0030.00317.48
8.1.60.0000.00817.62
8.1.50.0040.00417.51
8.1.40.0050.00517.48
8.1.30.0080.00017.57
8.1.20.0000.00817.64
8.1.10.0080.00017.57
8.1.00.0050.00317.38
8.0.300.0040.00418.77
8.0.290.0070.00016.63
8.0.280.0000.00818.36
8.0.270.0000.00717.22
8.0.260.0050.00218.81
8.0.250.0030.00616.87
8.0.240.0000.00816.78
8.0.230.0070.00016.80
8.0.220.0000.00716.88
8.0.210.0030.00316.87
8.0.200.0000.00617.02
8.0.190.0000.00916.86
8.0.180.0000.00816.99
8.0.170.0030.00616.88
8.0.160.0050.00316.91
8.0.150.0030.00616.88
8.0.140.0060.00616.87
8.0.130.0060.00013.34
8.0.120.0000.00716.86
8.0.110.0000.00716.93
8.0.100.0000.00716.88
8.0.90.0050.00316.89
8.0.80.0140.00316.89
8.0.70.0000.00716.89
8.0.60.0050.00316.83
8.0.50.0040.00416.76
8.0.30.0080.01217.10
8.0.20.0130.00617.42
8.0.10.0000.00716.84
8.0.00.0060.01616.85
7.4.330.0050.00016.88
7.4.320.0070.00016.53
7.4.300.0000.00716.63
7.4.290.0030.00316.61
7.4.280.0000.00816.60
7.4.270.0060.00316.51
7.4.260.0000.00716.57
7.4.250.0020.00516.43
7.4.240.0030.00416.42
7.4.230.0030.00316.66
7.4.220.0070.01116.55
7.4.210.0110.01016.60
7.4.200.0000.00816.60
7.4.160.0130.00616.45
7.4.150.0120.00617.40
7.4.140.0120.00617.86
7.4.130.0070.01116.66
7.4.120.0140.00716.49
7.4.110.0110.01116.50
7.4.100.0060.01216.38
7.4.90.0070.01016.56
7.4.80.0070.01119.39
7.4.70.0120.00916.51
7.4.60.0040.01116.46
7.4.50.0080.01116.59
7.4.40.0090.00616.59
7.4.30.0160.00616.57
7.4.00.0120.00314.69
7.3.330.0030.00313.17
7.3.320.0000.00513.17
7.3.310.0070.00016.30
7.3.300.0000.00716.18
7.3.290.0060.00716.33
7.3.280.0110.00516.29
7.3.270.0140.00317.40
7.3.260.0190.00516.31
7.3.250.0140.00916.39
7.3.240.0120.00416.35
7.3.230.0080.01116.30
7.3.210.0100.01016.31
7.3.200.0080.00816.31
7.3.190.0100.00616.20
7.3.180.0110.00416.61
7.3.170.0130.00316.30
7.3.160.0090.01016.32
7.3.10.0640.00016.67
7.3.00.0330.00316.80
7.2.330.0140.00716.39
7.2.320.0120.00616.43
7.2.310.0080.00816.80
7.2.300.0040.01616.61
7.2.290.0080.00816.91
7.2.130.0330.00716.87
7.2.120.0350.00617.03
7.2.110.0350.00216.94
7.2.100.0210.00916.84
7.2.90.0190.00816.79
7.2.80.0160.01017.04
7.2.70.0070.00916.97
7.2.60.0100.00516.81
7.2.50.0070.00916.96
7.2.40.0080.00916.97
7.2.30.0070.00516.83
7.2.20.0080.00716.83
7.2.10.0070.00716.98
7.2.00.0070.00816.88
7.1.250.0200.00715.75
7.1.240.0030.00915.39
7.1.230.0100.00315.85
7.1.220.0030.01015.63
7.1.210.0000.01315.94
7.1.200.0080.00515.71
7.1.190.0000.01015.84
7.1.180.0090.00015.88
7.1.170.0090.00315.85
7.1.160.0040.01115.88
7.1.150.0070.00715.71
7.1.140.0030.00615.54
7.1.130.0060.00615.62
7.1.120.0060.00615.73
7.1.110.0000.00715.85
7.1.100.0000.01215.86
7.1.90.0060.00615.82
7.1.80.0100.00315.68
7.1.70.0090.00516.53
7.1.60.0450.01224.45
7.1.50.0520.01024.45
7.1.40.0350.01024.17
7.1.30.0520.01224.10
7.1.20.0350.01324.26
7.1.10.0280.01115.28
7.1.00.0370.01115.39
7.0.330.0060.00615.37
7.0.320.0000.01015.55
7.0.310.0040.00815.41
7.0.300.0040.00415.42
7.0.290.0000.01115.55
7.0.280.0070.00015.43
7.0.270.0030.00915.20
7.0.260.0060.00615.48
7.0.250.0090.00315.49
7.0.240.0030.00615.29
7.0.230.0040.00415.21
7.0.220.0100.00315.31
7.0.210.0060.00615.29
7.0.200.0550.01215.23
7.0.190.0550.00915.16
7.0.180.0410.00214.96
7.0.170.0330.00614.95
7.0.160.0320.01415.05
7.0.150.0360.01014.84
7.0.140.0320.00314.80
7.0.130.0330.00715.16
7.0.120.0320.00914.93
7.0.110.0340.00914.86
7.0.100.0370.00514.98
7.0.90.0260.00814.84
7.0.80.0250.01014.97
7.0.70.0350.01014.99
7.0.60.0260.00815.01
7.0.50.0270.01015.10
7.0.40.0300.01014.10
7.0.30.0330.01014.05
7.0.20.0380.00614.01
7.0.10.0250.01013.76
7.0.00.0310.00714.03
5.6.380.0070.00714.11

preferences:
42.59 ms | 400 KiB | 5 Q