3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Stuff { function __invoke() { return 'I am ' . get_class($this) . '.'; } } class Thing { function __invoke() { return 'I am Thing.'; } } class Thang { use Stuff; } $things[] = function () { return 'I am Thong.'; }; $things[] = new Thing; $things[] = new Thang; $things[] = 'strlen'; $things[] = [$things[0], '__invoke']; $things[] = [$things[1], '__invoke']; var_dump(array_map('is_callable', $things)); var_dump(array_map(function ($thing) { return is_object($thing) && method_exists($thing, '__invoke'); }, $things)); var_dump(array_map(function ($thing) { return is_callable($thing) && !is_string($thing); }, $things));

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.00318.56
8.3.50.0120.00521.27
8.3.40.0070.00718.83
8.3.30.0150.00020.20
8.3.20.0040.00418.73
8.3.10.0040.00421.09
8.3.00.0080.00019.78
8.2.180.0120.00616.50
8.2.170.0120.00922.96
8.2.160.0110.00320.24
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0030.00626.16
8.2.120.0070.00020.89
8.2.110.0000.00922.02
8.2.100.0080.00417.72
8.2.90.0000.00817.63
8.2.80.0030.00518.79
8.2.70.0050.00317.63
8.2.60.0030.00518.04
8.2.50.0060.00318.07
8.2.40.0030.00620.00
8.2.30.0000.00719.45
8.2.20.0040.00417.74
8.2.10.0000.00717.77
8.2.00.0050.00317.74
8.1.280.0120.00625.92
8.1.270.0030.00623.99
8.1.260.0000.00826.35
8.1.250.0050.00328.09
8.1.240.0070.00422.11
8.1.230.0030.00922.82
8.1.220.0060.00317.74
8.1.210.0000.00818.77
8.1.200.0100.00017.35
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0040.00418.39
8.1.160.0040.00419.01
8.1.150.0040.00418.60
8.1.140.0050.00317.46
8.1.130.0040.00417.89
8.1.120.0040.00417.52
8.1.110.0050.00317.41
8.1.100.0000.00717.33
8.1.90.0040.00417.39
8.1.80.0040.00417.46
8.1.70.0030.00317.47
8.1.60.0040.00717.59
8.1.50.0000.00817.55
8.1.40.0030.00517.51
8.1.30.0000.00817.57
8.1.20.0000.00817.70
8.1.10.0040.00417.61
8.1.00.0000.01017.38
8.0.300.0060.00318.77
8.0.290.0000.00716.63
8.0.280.0000.00718.46
8.0.270.0040.00416.84
8.0.260.0030.00316.75
8.0.250.0000.00716.99
8.0.240.0000.00817.05
8.0.230.0000.00716.91
8.0.220.0030.00316.89
8.0.210.0040.00416.91
8.0.200.0060.00016.95
8.0.190.0040.00416.93
8.0.180.0000.00816.95
8.0.170.0070.00016.83
8.0.160.0000.00816.95
8.0.150.0080.00016.88
8.0.140.0030.00516.88
8.0.130.0060.00013.34
8.0.120.0030.00516.89
8.0.110.0040.00416.78
8.0.100.0000.00716.69
8.0.90.0040.00417.02
8.0.80.0100.00716.86
8.0.70.0070.00016.80
8.0.60.0000.00716.89
8.0.50.0040.00416.80
8.0.30.0060.01716.85
8.0.20.0130.01217.40
8.0.10.0080.00017.01
8.0.00.0060.01216.89
7.4.330.0000.00516.74
7.4.320.0030.00316.46
7.4.300.0030.00316.52
7.4.290.0030.00316.46
7.4.280.0030.00316.57
7.4.270.0030.00316.32
7.4.260.0000.00513.23
7.4.250.0040.00416.37
7.4.240.0030.00316.57
7.4.230.0000.00716.54
7.4.220.0140.00916.35
7.4.210.0060.00916.53
7.4.200.0000.00716.42
7.4.190.0000.00716.32
7.4.160.0060.01216.43
7.4.150.0110.00817.40
7.4.140.0170.00117.86
7.4.130.0110.01016.51
7.4.120.0150.00816.43
7.4.110.0090.00816.54
7.4.100.0090.00916.55
7.4.90.0060.01216.59
7.4.80.0080.00816.72
7.4.70.0170.00416.35
7.4.60.0060.01316.42
7.4.50.0050.00316.29
7.4.40.0120.00322.77
7.4.30.0060.01016.43
7.4.00.0000.01814.73
7.3.330.0050.00013.26
7.3.320.0000.00613.32
7.3.310.0070.00016.16
7.3.300.0000.00716.27
7.3.290.0090.00616.15
7.3.280.0080.00616.25
7.3.270.0070.01117.40
7.3.260.0100.00918.24
7.3.250.0120.01016.33
7.3.240.0030.01316.56
7.3.230.0110.00716.39
7.3.210.0110.00516.22
7.3.200.0060.01319.39
7.3.190.0080.00916.28
7.3.180.0060.01316.55
7.3.170.0130.00316.43
7.3.160.0100.00716.36
7.3.120.0100.00714.66
7.2.330.0110.00716.59
7.2.320.0120.00616.75
7.2.310.0100.01016.47
7.2.300.0070.01016.51
7.2.290.0150.00616.76
7.2.00.0030.01019.25
7.1.100.0030.01318.24
7.1.70.0030.00917.19
7.1.60.0060.01819.24
7.1.50.0180.00334.64
7.1.00.0030.03322.33
7.0.200.0000.01116.78
7.0.140.0000.07722.12
7.0.110.0430.04719.89
7.0.100.0500.08020.07
7.0.90.0500.08320.01
7.0.80.0470.06019.93
7.0.70.0400.07319.93
7.0.60.0370.04020.10
7.0.50.0500.08020.07
7.0.40.0030.08719.71
7.0.30.0030.07019.86
7.0.20.0000.08719.70
7.0.10.0070.07719.65
7.0.00.0030.06019.79
5.6.260.0070.08320.71
5.6.250.0030.07720.68
5.6.240.0170.07020.68
5.6.230.0070.08320.71
5.6.220.0030.08320.68
5.6.210.0130.07020.62
5.6.200.0070.08720.57
5.6.190.0170.07320.64
5.6.180.0130.03720.72
5.6.170.0000.09020.67
5.6.160.0070.08320.66
5.6.150.0130.07720.59
5.6.140.0130.07720.61
5.6.130.0070.04720.71
5.6.120.0000.07320.59
5.6.110.0130.07320.55
5.6.100.0170.07020.46
5.6.90.0130.07720.60
5.6.80.0070.04020.04
5.6.70.0130.06720.09
5.6.60.0070.08020.06
5.6.50.0000.05719.95
5.6.40.0100.04319.96
5.6.30.0000.08320.02
5.6.20.0030.03720.06
5.6.10.0030.04020.05
5.6.00.0100.07319.94
5.5.380.0000.08017.73
5.5.370.0000.07017.61
5.5.360.0070.07717.52
5.5.350.0000.04017.66
5.5.340.0100.08718.25
5.5.330.0000.08718.05
5.5.320.0100.07317.96
5.5.310.0100.06317.83
5.5.300.0100.07718.22
5.5.290.0000.05318.13
5.5.280.0030.08017.83
5.5.270.0130.04318.10
5.5.260.0100.07717.93
5.5.250.0070.08017.94
5.5.240.0070.07017.30
5.5.230.0030.08717.43
5.5.220.0030.07317.61
5.5.210.0100.08017.43
5.5.200.0070.05317.61
5.5.190.0030.05317.48
5.5.180.0070.06717.43
5.5.160.0030.05717.41
5.5.150.0100.06317.28
5.5.140.0030.08017.28
5.5.130.0070.04317.48
5.5.120.0130.04017.45
5.5.110.0070.06717.54
5.5.100.0030.05317.17
5.5.90.0070.07017.16
5.5.80.0030.07717.21
5.5.70.0070.04717.30
5.5.60.0070.07017.30
5.5.50.0130.06317.07
5.5.40.0070.04717.15
5.5.30.0070.07317.34
5.5.20.0100.06317.31
5.5.10.0030.08317.31
5.5.00.0070.07717.15
5.4.450.0100.07719.50
5.4.440.0100.06319.50
5.4.430.0070.04319.50
5.4.420.0030.04719.65
5.4.410.0070.04319.34
5.4.400.0130.07019.14
5.4.390.0100.06718.98
5.4.380.0070.08019.19
5.4.370.0030.08319.09
5.4.360.0070.04319.16
5.4.350.0070.04719.19
5.4.340.0100.07019.04
5.4.320.0070.05719.31
5.4.310.0230.02719.23
5.4.300.0030.04319.18
5.4.290.0070.08019.25
5.4.280.0070.05718.98
5.4.270.0100.07319.01
5.4.260.0070.04319.17
5.4.250.0070.04319.18
5.4.240.0070.07319.02
5.4.230.0070.07019.00
5.4.220.0070.07719.22
5.4.210.0070.08018.95
5.4.200.0100.07319.21
5.4.190.0100.04019.13
5.4.180.0030.06718.99
5.4.170.0030.06318.98
5.4.160.0100.07719.22
5.4.150.0030.08018.89
5.4.140.0000.08316.51
5.4.130.0070.05016.56
5.4.120.0070.04716.34
5.4.110.0030.03716.71
5.4.100.0030.07016.32
5.4.90.0000.08016.52
5.4.80.0100.06016.51
5.4.70.0030.06016.63
5.4.60.0030.07016.48
5.4.50.0100.07016.52
5.4.40.0030.07716.23
5.4.30.0000.04716.28
5.4.20.0030.07016.43
5.4.10.0170.06716.62
5.4.00.0070.07015.77
5.3.290.0070.08014.77
5.3.280.0070.08014.61
5.3.270.0130.06014.61
5.3.260.0070.07014.60
5.3.250.0070.05014.43
5.3.240.0130.07014.49
5.3.230.0100.06714.42
5.3.220.0070.05014.43
5.3.210.0070.07714.64
5.3.200.0030.08014.45
5.3.190.0070.04714.41
5.3.180.0070.06014.50
5.3.170.0070.04314.50
5.3.160.0070.04314.64
5.3.150.0030.07714.51
5.3.140.0030.07714.58
5.3.130.0070.08014.55
5.3.120.0100.08014.57
5.3.110.0100.07314.43
5.3.100.0070.07013.99
5.3.90.0070.07713.90
5.3.80.0070.05713.98
5.3.70.0030.04314.08
5.3.60.0070.07714.01
5.3.50.0030.07013.79
5.3.40.0070.06013.79
5.3.30.0030.07313.77
5.3.20.0100.06713.59
5.3.10.0070.06013.50
5.3.00.0200.06013.49
5.2.170.0070.03011.84
5.2.160.0070.03711.84
5.2.150.0000.03311.84
5.2.140.0030.06011.84
5.2.130.0000.05711.84
5.2.120.0030.04711.84
5.2.110.0030.04311.84
5.2.100.0070.06011.84
5.2.90.0070.06311.84
5.2.80.0130.07311.84
5.2.70.0000.06311.84
5.2.60.0070.03311.84
5.2.50.0070.06011.84
5.2.40.0070.06011.84
5.2.30.0070.03311.84
5.2.20.0100.05311.84
5.2.10.0030.06011.84
5.2.00.0030.03011.84
5.1.60.0000.05011.84
5.1.50.0100.05011.84
5.1.40.0030.05311.84
5.1.30.0070.05311.84
5.1.20.0030.05311.84
5.1.10.0070.05311.84
5.1.00.0070.05311.84
5.0.50.0070.04711.84
5.0.40.0030.03011.84
5.0.30.0030.05011.84
5.0.20.0000.05011.84
5.0.10.0000.03311.84
5.0.00.0070.04711.84
4.4.90.0030.03311.84
4.4.80.0130.02311.84
4.4.70.0000.03311.84
4.4.60.0000.03011.84
4.4.50.0000.03311.84
4.4.40.0030.03711.84
4.4.30.0030.03311.84
4.4.20.0070.03311.84
4.4.10.0100.02711.84
4.4.00.0100.04311.84
4.3.110.0030.03711.84
4.3.100.0030.01711.84
4.3.90.0000.03711.84
4.3.80.0030.05011.84
4.3.70.0030.02311.84
4.3.60.0000.03311.84
4.3.50.0000.03311.84
4.3.40.0000.03011.84
4.3.30.0000.03711.84
4.3.20.0000.03711.84
4.3.10.0000.03711.84
4.3.00.0000.03311.84

preferences:
55.09 ms | 401 KiB | 5 Q