3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Controller { protected $wrapped = []; public function abc($request) { // did we wrap this yet? if (! isset($this->wrapped['abc'])) { // if not, do it now. this will only happen once (unless you clear it out). $this->wrapped['abc'] = $this->wrap( function ($request) { return "abc\n"; } ); } // invoke and return. return $this->wrapped['abc']($request); } protected function wrap(callable $inner_controller) { return function($request) use ($inner_controller) { // stuff $response = $inner_controller($request); // stuff return $response; }; } } $ctrl = new Controller(); echo $ctrl->abc('the request');

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.4.20.0190.00017.78
8.4.10.0060.00319.63
8.3.150.0110.00720.45
8.3.140.0030.00616.46
8.3.130.0090.00018.42
8.3.120.0030.00518.77
8.3.110.0030.00520.94
8.3.100.0090.00024.06
8.3.90.0070.01126.77
8.3.80.0040.00419.36
8.3.70.0120.00916.63
8.3.60.0140.00416.63
8.3.50.0120.00623.04
8.3.40.0120.00318.93
8.3.30.0070.00718.85
8.3.20.0040.00422.08
8.3.10.0030.00523.59
8.3.00.0090.00019.97
8.2.260.0060.01218.49
8.2.250.0060.00318.22
8.2.240.0070.00317.05
8.2.230.0080.00022.58
8.2.220.0090.00037.54
8.2.210.0040.00426.77
8.2.200.0060.00316.63
8.2.190.0150.00016.63
8.2.180.0150.00325.92
8.2.170.0140.00722.96
8.2.160.0070.00721.02
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0000.00722.25
8.2.120.0000.00726.35
8.2.110.0080.00322.19
8.2.100.0120.00018.22
8.2.90.0080.00019.20
8.2.80.0000.00917.97
8.2.70.0040.00417.50
8.2.60.0000.00918.05
8.2.50.0060.00318.10
8.2.40.0000.00820.32
8.2.30.0000.00721.07
8.2.20.0040.00417.82
8.2.10.0080.00018.14
8.2.00.0000.00718.01
8.1.310.0030.00716.82
8.1.300.0140.00018.64
8.1.290.0030.00618.88
8.1.280.0120.00325.92
8.1.270.0000.00823.82
8.1.260.0080.00028.09
8.1.250.0040.00428.09
8.1.240.0060.00322.72
8.1.230.0040.00717.83
8.1.220.0030.00517.79
8.1.210.0050.00318.77
8.1.200.0060.00317.48
8.1.190.0060.00317.23
8.1.180.0040.00418.10
8.1.170.0050.00318.61
8.1.160.0000.00722.14
8.1.150.0000.00720.91
8.1.140.0000.00719.59
8.1.130.0030.00317.76
8.1.120.0030.00617.51
8.1.110.0000.00817.39
8.1.100.0060.00317.48
8.1.90.0030.00617.45
8.1.80.0080.00017.47
8.1.70.0000.00717.51
8.1.60.0060.00317.48
8.1.50.0000.00817.38
8.1.40.0000.00817.52
8.1.30.0040.00417.64
8.1.20.0000.00717.57
8.1.10.0040.00417.50
8.1.00.0040.00417.56
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0070.00018.58
8.0.270.0070.00017.27
8.0.260.0060.00017.19
8.0.250.0030.00316.93
8.0.240.0090.00016.92
8.0.230.0040.00417.05
8.0.220.0030.00316.97
8.0.210.0070.00016.88
8.0.200.0060.00016.99
8.0.190.0000.00717.02
8.0.180.0000.00817.06
8.0.170.0060.00316.97
8.0.160.0040.00416.81
8.0.150.0030.00316.92
8.0.140.0000.00716.96
8.0.130.0030.00313.34
8.0.120.0000.00816.90
8.0.110.0040.00416.91
8.0.100.0060.00316.88
8.0.90.0000.00716.88
8.0.80.0130.00716.86
8.0.70.0000.00716.83
8.0.60.0000.00816.85
8.0.50.0000.00716.84
8.0.30.0120.01017.16
8.0.20.0130.00617.40
8.0.10.0030.00317.03
8.0.00.0100.00716.76
7.4.330.0050.00015.08
7.4.320.0030.00316.57
7.4.300.0060.00016.62
7.4.290.0000.00716.50
7.4.280.0080.00016.57
7.4.270.0000.00716.65
7.4.260.0030.00316.65
7.4.250.0070.00016.49
7.4.240.0050.00216.51
7.4.230.0030.00316.54
7.4.220.0150.00316.70
7.4.210.0180.00316.48
7.4.200.0070.00016.70
7.4.160.0110.00816.41
7.4.150.0120.00617.40
7.4.140.0070.01017.86
7.4.130.0070.01116.57
7.4.120.0110.00916.47
7.4.110.0140.00716.64
7.4.100.0130.01016.57
7.4.90.0130.00616.61
7.4.80.0030.01319.39
7.4.70.0130.00416.39
7.4.60.0090.01216.60
7.4.50.0100.00316.37
7.4.40.0070.01016.41
7.4.30.0040.01216.46
7.4.00.0030.01214.92
7.3.330.0050.00013.36
7.3.320.0000.00513.38
7.3.310.0030.00316.42
7.3.300.0000.00716.39
7.3.290.0120.00516.35
7.3.280.0100.00816.37
7.3.270.0060.01217.40
7.3.260.0110.01116.57
7.3.250.0120.00916.59
7.3.240.0100.00716.55
7.3.230.0100.00716.46
7.3.210.0080.00816.59
7.3.200.0070.01016.34
7.3.190.0130.00316.48
7.3.180.0070.01016.41
7.3.170.0070.01016.39
7.3.160.0070.01016.41
7.2.330.0120.00916.78
7.2.320.0060.01016.79
7.2.310.0100.00716.80
7.2.300.0150.00316.70
7.2.290.0110.01116.72
7.2.60.0160.00716.91
7.1.200.0090.00315.70
7.1.70.0030.00716.95
7.1.60.0090.00319.75
7.1.00.0000.07722.57
7.0.200.1300.00314.46
7.0.90.0870.00020.10
7.0.80.0770.00019.96
7.0.70.0870.00020.02
7.0.60.0700.00019.99
7.0.50.0730.00020.31
7.0.40.0800.00020.36
7.0.30.0730.00020.43
7.0.20.0730.00020.34
7.0.10.0870.00020.30
7.0.00.0770.00020.31
5.6.240.0770.00020.73
5.6.230.0730.00020.64
5.6.220.0900.00020.56
5.6.210.0770.00020.75
5.6.200.0700.00021.02
5.6.190.0700.00021.10
5.6.180.0870.00021.10
5.6.170.0700.00021.09
5.6.160.0800.00021.19
5.6.150.0700.00021.09
5.6.140.0700.00021.03
5.6.130.0730.00021.09
5.6.120.0770.00021.09
5.6.110.0700.00021.07
5.6.100.0930.00021.08
5.6.90.0670.00021.06
5.6.80.0770.00020.54
5.6.70.0700.00020.48
5.6.60.0670.00020.51
5.6.50.0700.00020.48
5.6.40.0670.00020.54
5.6.30.0670.00020.45
5.6.20.0700.00020.45
5.6.10.0670.00020.47
5.6.00.0700.00020.45

preferences:
66.3 ms | 403 KiB | 5 Q