3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $value = 'HI'; public function filter_callable(callable $p) { return $p($this); } public function filter_closure(\Closure $p) { return $p($this); } private function getValue() { return $this->value; } } $foo = new Foo(); echo $foo->filter_callable([$foo, 'getValue']); echo $foo->filter_closure(function($p) { return $p->getValue(); });

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.0120.00618.25
8.3.50.0040.01116.12
8.3.40.0090.00618.84
8.3.30.0070.01018.59
8.3.20.0040.00421.85
8.3.10.0090.00622.03
8.3.00.0110.00620.29
8.2.180.0120.00318.29
8.2.170.0040.01522.96
8.2.160.0130.00620.39
8.2.150.0030.00524.18
8.2.140.0080.00622.38
8.2.130.0090.00520.95
8.2.120.0100.00621.53
8.2.110.0120.00419.77
8.2.100.0080.00418.71
8.2.90.0060.00618.56
8.2.80.0060.01118.74
8.2.70.0070.00918.30
8.2.60.0050.00718.48
8.2.50.0080.00918.49
8.2.40.0040.00718.70
8.2.30.0050.00618.54
8.2.20.0060.00618.54
8.2.10.0080.00418.99
8.2.00.0080.00518.47
8.1.280.0180.00325.92
8.1.270.0060.00722.79
8.1.260.0080.00323.48
8.1.250.0040.00924.14
8.1.240.0090.00219.52
8.1.230.0100.00619.93
8.1.220.0070.00218.53
8.1.210.0060.00618.73
8.1.200.0080.00718.03
8.1.190.0070.00418.22
8.1.180.0060.00318.39
8.1.170.0040.00519.09
8.1.160.0060.00619.21
8.1.150.0060.00719.27
8.1.140.0040.00519.71
8.1.130.0030.00518.89
8.1.120.0070.00218.86
8.1.110.0030.00518.81
8.1.100.0070.00118.77
8.1.90.0030.00818.77
8.1.80.0060.00518.78
8.1.70.0010.00718.79
8.1.60.0060.00618.32
8.1.50.0060.00518.16
8.1.40.0030.00718.29
8.1.30.0050.00418.46
8.1.20.0060.00218.36
8.1.10.0040.00418.17
8.1.00.0050.00318.04
8.0.300.0020.00718.58
8.0.290.0120.00117.40
8.0.280.0080.00418.62
8.0.270.0060.00217.67
8.0.260.0080.00317.61
8.0.250.0020.00617.67
8.0.240.0110.00217.56
8.0.230.0070.00417.66
8.0.220.0040.00617.58
8.0.210.0100.00217.53
8.0.200.0040.00617.61
8.0.190.0050.00617.36
8.0.180.0040.00317.62
8.0.170.0110.00217.57
8.0.160.0030.00517.58
8.0.150.0090.00317.60
8.0.140.0100.00517.40
8.0.130.0110.00516.47
8.0.120.0070.00517.38
8.0.110.0040.00417.25
8.0.100.0090.00117.39
8.0.90.0080.00317.34
8.0.80.0090.00517.77
8.0.70.0070.00417.43
8.0.60.0080.00717.39
8.0.50.0060.00517.42
8.0.30.0050.00617.43
8.0.20.0100.00617.61
8.0.10.0120.01017.54
8.0.00.0100.00817.64
7.4.330.0130.00714.50
7.4.320.0160.00817.03
7.4.300.0210.00417.12
7.4.290.0120.00616.91
7.4.280.0110.00817.14
7.4.270.0160.00617.07
7.4.260.0170.00416.99
7.4.250.0160.00416.98
7.4.240.0120.00516.86
7.4.230.0140.00517.01
7.4.220.0140.00317.05
7.4.210.0140.00716.79
7.4.200.0160.00317.01
7.4.190.0200.00217.26
7.4.180.0120.00517.23
7.4.160.0090.00816.84
7.4.150.0140.00317.17
7.4.140.0120.00717.16
7.4.130.0110.00516.92
7.4.120.0090.00916.89
7.4.110.0090.00816.97
7.4.100.0120.00716.96
7.4.90.0120.00716.82
7.4.80.0120.00917.29
7.4.70.0140.00716.86
7.4.60.0130.00916.83
7.4.50.0140.00916.80
7.4.40.0140.01016.87
7.4.30.0140.00916.92
7.4.20.0110.00816.88
7.4.10.0160.00816.92
7.4.00.0110.01216.50
7.3.330.0120.00416.13
7.3.320.0140.00516.10
7.3.310.0180.00416.77
7.3.300.0120.00617.06
7.3.290.0160.00216.87
7.3.280.0140.00616.64
7.3.270.0170.00517.01
7.3.260.0160.00616.74
7.3.250.0110.00816.94
7.3.240.0120.00816.71
7.3.230.0120.00716.88
7.3.220.0150.00716.99
7.3.210.0090.01116.81
7.3.200.0130.00616.78
7.3.190.0140.00916.78
7.3.180.0150.00816.78
7.3.170.0120.00916.96
7.3.160.0150.00716.81
7.3.150.0170.00516.80
7.3.140.0190.01116.87
7.3.130.0200.00916.84
7.3.120.0150.00716.63
7.3.110.0150.00916.60
7.3.100.0160.00516.24
7.3.90.0150.00716.08
7.3.80.0110.00716.02
7.3.70.0110.00715.94
7.3.60.0110.00715.85
7.3.50.0120.01015.80
7.3.40.0140.00615.77
7.3.30.0110.00715.81
7.3.20.0210.00816.21
7.3.10.0230.00616.26
7.3.00.0160.00816.27
7.2.340.0220.00416.94
7.2.330.0170.00816.94
7.2.320.0160.00716.92
7.2.310.0180.00816.81
7.2.300.0190.00816.89
7.2.290.0160.00916.88
7.2.280.0190.00816.87
7.2.270.0240.01017.05
7.2.260.0250.00717.05
7.2.250.0170.00816.68
7.2.240.0160.00916.66
7.2.230.0180.00716.48
7.2.220.0150.00616.19
7.2.210.0150.00716.17
7.2.200.0180.00516.09
7.2.190.0170.01015.98
7.2.180.0150.00816.03
7.2.170.0160.00816.06
7.2.160.0160.00816.17
7.2.150.0200.01016.56
7.2.140.0240.00816.52
7.2.130.0230.01016.55
7.2.120.0250.00716.55
7.2.110.0250.00916.46
7.2.100.0230.01016.57
7.2.90.0240.00516.53
7.2.80.0230.00816.53
7.2.70.0220.00816.52
7.2.60.0220.00816.52
7.2.50.0230.01116.52
7.2.40.0230.00716.52
7.2.30.0200.00816.52
7.2.20.0230.00816.55
7.2.10.0210.00616.58
7.2.00.0220.00816.57
7.1.330.0120.00516.81
7.1.320.0170.00515.77
7.1.310.0160.00915.81
7.1.300.0170.00915.66
7.1.290.0150.00715.65
7.1.280.0150.00815.66
7.1.270.0220.00715.81
7.1.260.0140.00715.62
7.1.250.0210.00915.42
7.1.240.0170.00616.03
7.1.230.0160.00916.02
7.1.220.0180.00815.99
7.1.210.0180.00915.99
7.1.200.0190.00816.03
7.1.190.0200.00816.03
7.1.180.0170.00815.94
7.1.170.0170.00816.02
7.1.160.0210.00816.07
7.1.150.0170.00716.05
7.1.140.0200.00415.94
7.1.130.0220.00516.02
7.1.120.0180.00716.02
7.1.110.0180.00816.00
7.1.100.0110.01116.02
7.1.90.0160.00815.99
7.1.80.0180.00815.99
7.1.70.0220.00815.92
7.1.60.0170.00815.99
7.1.50.0230.00615.97
7.1.40.0200.00816.01
7.1.30.0190.00616.03
7.1.20.0200.00815.95
7.1.10.0180.00916.25
7.1.00.0210.00915.99

preferences:
55.66 ms | 401 KiB | 5 Q