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.4.120.0140.00423.99
8.4.110.0110.00918.84
8.4.100.0110.00618.02
8.4.90.0140.00520.91
8.4.80.0110.00918.89
8.4.70.0060.00219.16
8.4.60.0100.01020.82
8.4.50.0100.01018.69
8.4.40.0130.00619.67
8.4.30.0130.00717.81
8.4.20.0130.00320.46
8.4.10.0090.00019.87
8.3.250.0110.00916.43
8.3.240.0120.00817.32
8.3.230.0110.00816.59
8.3.220.0120.00420.80
8.3.210.0110.01016.58
8.3.200.0050.00416.75
8.3.190.0180.00716.83
8.3.180.0110.00716.78
8.3.170.0090.00617.19
8.3.160.0100.00720.66
8.3.150.0080.00817.04
8.3.140.0150.00917.33
8.3.130.0090.00618.53
8.3.120.0030.01320.74
8.3.110.0040.00420.94
8.3.100.0090.00024.06
8.3.90.0210.01021.77
8.3.80.0220.00722.37
8.3.70.0280.00921.76
8.3.60.0250.00822.51
8.3.50.0180.01020.29
8.3.40.0210.00722.80
8.3.30.0210.00922.68
8.3.20.0190.00824.31
8.3.10.0170.00723.22
8.3.00.0140.00621.91
8.2.290.0080.00420.20
8.2.280.0110.00920.28
8.2.270.0040.00417.18
8.2.260.0000.00816.89
8.2.250.0040.00416.96
8.2.240.0050.00317.17
8.2.230.0080.00022.58
8.2.220.0040.00437.54
8.2.210.0110.00926.77
8.2.200.0180.00621.57
8.2.190.0240.00522.66
8.2.180.0240.00322.53
8.2.170.0240.00924.87
8.2.160.0270.00523.58
8.2.150.0210.00425.47
8.2.140.0150.00623.47
8.2.130.0160.00522.40
8.2.120.0170.00622.84
8.2.110.0180.00521.52
8.2.100.0160.00420.72
8.2.90.0130.00720.61
8.2.80.0120.01120.74
8.2.70.0140.00820.41
8.2.60.0070.00820.55
8.2.50.0160.00720.56
8.2.40.0120.00620.72
8.2.30.0130.00520.60
8.2.20.0120.00720.60
8.2.10.0150.00520.93
8.2.00.0160.00620.55
8.1.330.0140.00521.75
8.1.320.0100.00615.94
8.1.310.0100.00718.56
8.1.300.0130.00618.21
8.1.290.0240.00528.80
8.1.280.0270.00326.34
8.1.270.0070.00823.79
8.1.260.0160.00324.30
8.1.250.0090.00924.79
8.1.240.0120.00621.33
8.1.230.0170.00621.64
8.1.220.0120.00420.59
8.1.210.0110.00820.74
8.1.200.0150.00620.21
8.1.190.0130.00520.36
8.1.180.0120.00520.48
8.1.170.0130.00521.01
8.1.160.0120.00521.10
8.1.150.0100.00821.14
8.1.140.0110.00621.48
8.1.130.0150.00420.86
8.1.120.0160.00220.84
8.1.110.0090.00720.79
8.1.100.0110.00320.77
8.1.90.0110.00720.77
8.1.80.0120.00620.78
8.1.70.0090.00620.78
8.1.60.0100.00719.38
8.1.50.0110.00520.31
8.1.40.0070.00820.41
8.1.30.0070.00420.54
8.1.20.0120.00420.46
8.1.10.0110.00519.89
8.1.00.0110.00419.78
8.0.300.0070.00820.63
8.0.290.0150.00319.74
8.0.280.0140.00520.65
8.0.270.0140.00219.94
8.0.260.0140.00519.90
8.0.250.0070.00719.95
8.0.240.0150.00219.86
8.0.230.0110.00519.93
8.0.220.0090.00619.88
8.0.210.0130.00319.84
8.0.200.0110.00519.90
8.0.190.0110.00618.93
8.0.180.0110.00419.91
8.0.170.0150.00419.87
8.0.160.0110.00419.88
8.0.150.0150.00319.89
8.0.140.0120.00719.27
8.0.130.0160.00418.53
8.0.120.0110.00619.25
8.0.110.0090.00318.60
8.0.100.0130.00219.26
8.0.90.0140.00419.22
8.0.80.0150.00419.57
8.0.70.0110.00419.29
8.0.60.0100.00819.26
8.0.50.0090.00619.29
8.0.30.0080.00619.30
8.0.20.0110.00919.44
8.0.10.0160.01019.08
8.0.00.0110.00818.65
7.4.330.0150.00917.57
7.4.320.0180.01019.46
7.4.300.0240.00419.53
7.4.290.0140.00718.55
7.4.280.0160.00819.55
7.4.270.0190.00619.01
7.4.260.0200.00318.94
7.4.250.0190.00418.94
7.4.240.0150.00518.27
7.4.230.0170.00618.96
7.4.220.0190.00418.99
7.4.210.0170.00618.21
7.4.200.0180.00418.96
7.4.190.0200.00419.64
7.4.180.0160.00519.61
7.4.160.0110.00718.08
7.4.150.0140.00519.09
7.4.140.0130.00718.54
7.4.130.0130.00418.33
7.4.120.0100.00818.30
7.4.110.0100.00718.37
7.4.100.0120.00718.36
7.4.90.0130.00618.07
7.4.80.0110.00918.47
7.4.70.0140.00618.10
7.4.60.0130.00818.07
7.4.50.0140.00818.04
7.4.40.0150.01018.10
7.4.30.0170.00818.33
7.4.20.0130.00818.29
7.4.10.0190.00718.33
7.4.00.0130.01217.64
7.3.330.0150.00517.65
7.3.320.0150.00618.23
7.3.310.0170.00318.77
7.3.300.0130.00519.00
7.3.290.0160.00218.85
7.3.280.0140.00617.90
7.3.270.0160.00518.96
7.3.260.0180.00617.74
7.3.250.0140.00818.58
7.3.240.0130.00817.72
7.3.230.0130.00818.29
7.3.220.0170.00818.62
7.3.210.0120.01018.06
7.3.200.0160.00518.03
7.3.190.0150.00918.03
7.3.180.0170.00718.03
7.3.170.0140.00918.19
7.3.160.0170.00618.05
7.3.150.0180.00618.23
7.3.140.0200.01118.28
7.3.130.0220.00718.26
7.3.120.0160.00717.89
7.3.110.0180.00917.87
7.3.100.0160.00517.41
7.3.90.0140.00717.05
7.3.80.0120.00717.00
7.3.70.0120.00716.84
7.3.60.0120.00716.69
7.3.50.0130.01016.64
7.3.40.0150.00616.62
7.3.30.0130.00716.65
7.3.20.0210.00816.91
7.3.10.0240.00517.01
7.3.00.0170.00817.02
7.2.340.0220.00518.58
7.2.330.0170.00918.17
7.2.320.0180.00618.15
7.2.310.0190.00818.05
7.2.300.0190.00818.13
7.2.290.0170.00918.11
7.2.280.0210.00918.29
7.2.270.0260.00918.44
7.2.260.0250.00718.44
7.2.250.0170.00817.94
7.2.240.0170.00917.93
7.2.230.0190.00817.62
7.2.220.0180.00617.16
7.2.210.0160.00717.14
7.2.200.0190.00516.98
7.2.190.0180.01016.81
7.2.180.0160.00816.86
7.2.170.0160.00716.88
7.2.160.0180.00717.06
7.2.150.0200.00917.45
7.2.140.0240.00817.31
7.2.130.0240.01017.34
7.2.120.0250.00717.33
7.2.110.0260.00817.25
7.2.100.0230.01017.35
7.2.90.0240.00617.32
7.2.80.0230.00817.32
7.2.70.0220.00817.31
7.2.60.0220.00717.31
7.2.50.0230.01017.31
7.2.40.0230.00617.31
7.2.30.0200.00917.31
7.2.20.0230.00817.33
7.2.10.0200.00717.36
7.2.00.0220.00817.35
7.1.330.0120.00617.64
7.1.320.0170.00616.77
7.1.310.0160.00916.80
7.1.300.0180.00816.51
7.1.290.0160.00716.50
7.1.280.0160.00816.51
7.1.270.0220.00616.65
7.1.260.0150.00716.48
7.1.250.0210.00816.30
7.1.240.0190.00517.22
7.1.230.0170.00917.22
7.1.220.0180.00817.19
7.1.210.0190.00917.19
7.1.200.0200.00717.22
7.1.190.0200.00817.22
7.1.180.0180.00817.14
7.1.170.0180.00717.22
7.1.160.0210.00717.25
7.1.150.0180.00717.24
7.1.140.0200.00417.14
7.1.130.0220.00517.21
7.1.120.0170.00717.22
7.1.110.0180.00817.20
7.1.100.0140.01117.21
7.1.90.0180.00817.18
7.1.80.0190.00717.19
7.1.70.0230.00817.13
7.1.60.0180.00817.19
7.1.50.0230.00617.17
7.1.40.0200.00817.21
7.1.30.0200.00617.23
7.1.20.0200.00917.15
7.1.10.0180.01017.42
7.1.00.0210.00917.19

preferences:
30.61 ms | 403 KiB | 5 Q