3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f() {} class C { function f() {} static function s() {} function __invoke() { echo "In __invoke()\n"; var_dump(func_get_args()); } } $obj = new C; $anon = function() {}; function check_callable(callable $f) {} echo "f()\n"; check_callable('f'); var_dump(is_callable('f')); echo "C::s()\n"; check_callable(['C', 's']); var_dump(is_callable(['C', 's'])); check_callable('C::s'); var_dump(is_callable('C::s')); echo "Closure\n"; check_callable($anon); var_dump(is_callable($anon)); echo "C::__invoke()\n"; check_callable($obj); var_dump(is_callable($obj)); echo "C::f()\n"; check_callable([$obj, 'f']); var_dump(is_callable([$obj, 'f']));

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.0110.01116.75
8.3.50.0110.00821.00
8.3.40.0150.00018.59
8.3.30.0070.01018.86
8.3.20.0000.00720.33
8.3.10.0040.00421.74
8.3.00.0030.00519.12
8.2.180.0140.00616.50
8.2.170.0040.01118.91
8.2.160.0070.00722.96
8.2.150.0070.00025.66
8.2.140.0100.01024.66
8.2.130.0000.00826.16
8.2.120.0070.00420.75
8.2.110.0080.00320.89
8.2.100.0070.00717.75
8.2.90.0060.00319.22
8.2.80.0050.00317.97
8.2.70.0030.00517.38
8.2.60.0030.00617.80
8.2.50.0000.00818.07
8.2.40.0050.00319.74
8.2.30.0070.00018.05
8.2.20.0000.00717.79
8.2.10.0000.00818.01
8.2.00.0040.00418.10
8.1.280.0030.01725.92
8.1.270.0070.01120.33
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0030.00721.29
8.1.230.0080.00317.83
8.1.220.0000.00917.74
8.1.210.0040.00418.77
8.1.200.0030.00617.48
8.1.190.0000.00817.21
8.1.180.0040.00418.10
8.1.170.0080.00018.59
8.1.160.0040.00422.17
8.1.150.0000.00718.88
8.1.140.0050.00217.52
8.1.130.0070.00017.77
8.1.120.0000.00717.52
8.1.110.0040.00417.55
8.1.100.0040.00417.50
8.1.90.0000.00817.50
8.1.80.0040.00417.46
8.1.70.0070.00017.50
8.1.60.0040.00417.61
8.1.50.0020.00517.46
8.1.40.0040.00417.51
8.1.30.0000.00817.68
8.1.20.0000.00817.55
8.1.10.0080.00017.52
8.1.00.0040.00417.39
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0000.00718.34
8.0.270.0070.00017.13
8.0.260.0000.00717.19
8.0.250.0070.00016.94
8.0.240.0000.00617.05
8.0.230.0030.00316.93
8.0.220.0070.00016.97
8.0.210.0070.00017.05
8.0.200.0000.00617.08
8.0.190.0040.00416.99
8.0.180.0050.00516.91
8.0.170.0080.00016.89
8.0.160.0000.00716.88
8.0.150.0040.00416.93
8.0.140.0050.00316.97
8.0.130.0060.00013.44
8.0.120.0040.00416.97
8.0.110.0030.00316.99
8.0.100.0000.00716.88
8.0.90.0060.00316.93
8.0.80.0070.01016.95
8.0.70.0000.00716.96
8.0.60.0040.00416.76
8.0.50.0050.00216.96
8.0.30.0110.00817.23
8.0.20.0170.01617.40
8.0.10.0040.00416.92
8.0.00.0100.00916.92
7.4.330.0040.00415.04
7.4.320.0030.00316.53
7.4.300.0060.00016.66
7.4.290.0000.00716.42
7.4.280.0000.00816.65
7.4.270.0040.00416.58
7.4.260.0000.00816.46
7.4.250.0070.00016.39
7.4.240.0030.00316.55
7.4.230.0030.00316.70
7.4.220.0100.01016.52
7.4.210.0070.01216.53
7.4.200.0070.00016.42
7.4.160.0120.00616.49
7.4.150.0080.00917.40
7.4.140.0140.00917.86
7.4.130.0140.00916.49
7.4.120.0120.00816.63
7.4.110.0080.00816.36
7.4.100.0120.01216.41
7.4.90.0070.01016.34
7.4.80.0100.00719.39
7.4.70.0170.00716.50
7.4.60.0100.00716.45
7.4.50.0030.00616.57
7.4.40.0100.00616.59
7.4.30.0080.01116.44
7.4.00.0060.00915.03
7.3.330.0000.00513.28
7.3.320.0050.00013.33
7.3.310.0000.00716.35
7.3.300.0080.00016.41
7.3.290.0000.00716.34
7.3.280.0070.00716.35
7.3.270.0110.01417.40
7.3.260.0240.00016.46
7.3.250.0120.00916.39
7.3.240.0050.01616.46
7.3.230.0110.00816.61
7.3.210.0100.00716.41
7.3.200.0090.00819.39
7.3.190.0150.00916.53
7.3.180.0100.00616.40
7.3.170.0070.01016.47
7.3.160.0090.00616.34
7.3.10.0080.00816.59
7.3.00.0040.00716.36
7.2.330.0100.00716.45
7.2.320.0100.00716.74
7.2.310.0100.01016.45
7.2.300.0140.00716.57
7.2.290.0130.01016.84
7.2.130.0140.00016.43
7.2.120.0140.00316.94
7.2.110.0170.00716.91
7.2.100.0250.00716.68
7.2.90.0120.01216.80
7.2.80.0180.01116.62
7.2.70.0070.01116.48
7.2.60.0050.00916.88
7.2.50.0210.00916.90
7.2.40.0140.00316.81
7.2.30.0200.01016.93
7.2.20.0110.00717.03
7.2.10.0040.01416.97
7.2.00.0160.01118.09
7.1.250.0120.00315.56
7.1.200.0090.00615.71
7.1.100.0110.00018.03
7.1.70.0000.00817.22
7.1.60.0100.01019.59
7.1.50.0120.00316.63
7.1.00.0100.07022.45
7.0.200.0090.00316.88
7.0.60.0270.06019.97
7.0.50.0030.04717.90
7.0.40.0100.05020.06
7.0.30.0300.07320.26
7.0.20.0200.08020.33
7.0.10.0200.04720.25
7.0.00.0130.05020.25
5.6.280.0000.07720.82
5.6.210.0170.07320.71
5.6.200.0030.04318.29
5.6.190.0030.04320.46
5.6.180.3800.04020.64
5.6.170.0200.05020.52
5.6.160.0070.08320.62
5.6.150.0070.03718.14
5.6.140.0000.07318.23
5.6.130.0100.03718.17
5.6.120.0030.05720.97
5.6.110.0070.08021.02
5.6.100.0100.04321.02
5.6.90.0030.04720.98
5.6.80.0070.07720.39
5.6.70.3430.03720.36
5.5.350.0200.07020.31
5.5.340.0070.05318.09
5.5.330.0030.08720.27
5.5.320.0300.07020.36
5.5.310.0270.08320.32
5.5.300.0070.06318.08
5.5.290.0000.06717.95
5.5.280.0100.08320.91
5.5.270.0170.06020.80
5.5.260.0070.07720.80
5.5.250.0000.04720.48
5.5.240.0170.05720.26
5.4.450.0730.05319.40
5.4.440.0130.06319.20
5.4.430.0770.05319.63
5.4.420.1070.05019.28
5.4.410.0930.06719.43
5.4.400.1170.05719.16
5.4.390.0870.06319.23
5.4.380.0800.07019.26
5.4.370.0800.05719.25
5.4.360.0700.06319.16
5.4.350.1100.06318.96
5.4.340.0870.07319.19
5.4.320.0930.07319.11
5.4.310.1100.07319.23
5.4.300.0800.06318.89
5.4.290.0970.05318.96
5.4.280.0830.07319.25
5.4.270.0870.05319.08
5.4.260.1030.06319.22
5.4.250.0870.05319.11
5.4.240.1030.07719.21
5.4.230.1030.07719.21
5.4.220.0730.06719.18
5.4.210.0770.06719.28
5.4.200.0930.05316.80
5.4.190.1170.05318.98
5.4.180.1170.07019.11
5.4.170.0970.06019.23
5.4.160.0770.05319.23
5.4.150.0800.05719.10
5.4.140.0830.06016.70
5.4.130.0800.05016.48
5.4.120.0930.04716.31
5.4.110.0800.05016.50
5.4.100.0700.06016.46
5.4.90.0770.04316.63
5.4.80.0730.06316.54
5.4.70.0970.05016.50
5.4.60.0700.04716.45
5.4.50.0870.05716.43
5.4.40.0900.05016.51
5.4.30.0970.04316.44
5.4.20.0900.05316.42
5.4.10.0700.05716.44
5.4.00.0800.04716.00
5.3.290.0700.06314.68
5.3.280.0670.05014.50
5.3.270.0670.05014.68
5.3.260.0570.06014.50
5.3.250.0800.06714.63
5.3.240.0700.05014.67
5.3.230.0930.05714.52
5.3.220.0600.05714.65
5.3.210.0870.05314.64
5.3.200.0730.04314.53
5.3.190.0700.06014.50
5.3.180.0730.05314.58
5.3.170.0670.06714.68
5.3.160.0700.04714.53
5.3.150.0770.05014.62
5.3.140.0870.06314.55
5.3.130.0630.05314.46
5.3.120.0930.06014.46
5.3.110.0870.05714.59
5.3.100.0670.05313.91
5.3.90.0830.06013.99
5.3.80.1000.05014.09
5.3.70.0870.05013.93
5.3.60.0630.05713.99
5.3.50.0630.04714.02
5.3.40.0530.05713.86
5.3.30.0670.04713.98
5.3.20.0700.04313.61
5.3.10.0730.06313.72
5.3.00.0630.05013.71
5.2.170.0570.04011.12
5.2.160.0470.04311.00
5.2.150.0670.05011.09
5.2.140.0730.03711.30
5.2.130.0600.04711.06
5.2.120.0770.03711.27
5.2.110.0670.04311.04
5.2.100.0530.03311.07
5.2.90.0670.04011.09
5.2.80.0500.04711.00
5.2.70.0530.04311.11
5.2.60.0600.03311.00
5.2.50.0570.04010.93
5.2.40.0670.03710.95
5.2.30.0600.05010.90
5.2.20.0500.04310.88
5.2.10.0570.04310.86
5.2.00.0530.04310.79
5.1.60.0700.0409.93
5.1.50.0570.0339.89
5.1.40.0630.0309.88
5.1.30.0630.02710.30
5.1.20.0570.03310.38
5.1.10.0630.03010.18
5.1.00.0600.02710.00
5.0.50.0300.0208.49
5.0.40.0230.0238.33
5.0.30.0370.0408.07
5.0.20.0400.0208.30
5.0.10.0330.0238.10
5.0.00.0200.0438.27
4.4.90.0200.0275.87
4.4.80.0170.0275.75
4.4.70.0230.0205.86
4.4.60.0270.0175.84
4.4.50.0330.0175.79
4.4.40.0270.0335.74
4.4.30.0200.0305.90
4.4.20.0330.0175.96
4.4.10.0430.0235.92
4.4.00.0330.0475.96
4.3.110.0300.0305.87
4.3.100.0330.0275.79
4.3.90.0400.0235.65
4.3.80.0300.0375.68
4.3.70.0270.0205.69
4.3.60.0370.0275.75
4.3.50.0270.0275.73
4.3.40.0230.0405.70
4.3.30.0170.0234.57
4.3.20.0130.0274.43
4.3.10.0130.0174.46
4.3.00.0330.02016.93

preferences:
33.18 ms | 401 KiB | 5 Q