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'); })); var_dump(array_map(function ($thing) { return is_callable($thing, '__invoke') && !is_string($thing); }));

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.00418.80
8.3.50.0150.00721.09
8.3.40.0070.00718.79
8.3.30.0100.00720.39
8.3.20.0090.00018.74
8.3.10.0000.00821.22
8.3.00.0080.00019.92
8.2.180.0090.00916.75
8.2.170.0120.00422.96
8.2.160.0000.01420.36
8.2.150.0100.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0050.00219.83
8.2.110.0100.00021.07
8.2.100.0040.00818.03
8.2.90.0070.00019.30
8.2.80.0050.00219.33
8.2.70.0060.00317.63
8.2.60.0040.00418.05
8.2.50.0060.00318.07
8.2.40.0080.00020.07
8.2.30.0000.00719.54
8.2.20.0000.00717.84
8.2.10.0000.00717.87
8.2.00.0000.00817.87
8.1.270.0070.00723.99
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0000.00922.45
8.1.230.0040.00720.89
8.1.220.0040.00418.77
8.1.210.0030.00518.88
8.1.200.0060.00317.35
8.1.190.0050.00317.52
8.1.180.0050.00318.10
8.1.170.0060.00318.59
8.1.160.0080.00018.97
8.1.150.0040.00418.60
8.1.140.0020.00517.56
8.1.130.0000.00717.79
8.1.120.0040.00417.41
8.1.110.0040.00417.47
8.1.100.0000.00717.41
8.1.90.0030.00517.40
8.1.80.0050.00517.60
8.1.70.0070.00017.44
8.1.60.0050.00517.55
8.1.50.0030.00517.48
8.1.40.0000.00817.47
8.1.30.0000.00817.74
8.1.20.0030.00617.75
8.1.10.0040.00417.68
8.1.00.0000.00917.62
8.0.300.0040.00419.88
8.0.290.0000.00717.16
8.0.280.0000.00718.47
8.0.270.0030.00317.33
8.0.260.0030.00316.80
8.0.250.0040.00417.09
8.0.240.0000.00817.08
8.0.230.0000.00717.06
8.0.220.0070.00017.01
8.0.210.0030.00316.98
8.0.200.0000.00616.93
8.0.190.0000.00717.04
8.0.180.0000.00817.02
8.0.170.0040.00316.87
8.0.160.0000.00716.94
8.0.150.0030.00516.98
8.0.140.0070.00016.96
8.0.130.0030.00313.41
8.0.120.0030.00516.98
8.0.110.0040.00417.09
8.0.100.0040.00416.87
8.0.90.0040.00416.84
8.0.80.0060.01016.98
8.0.70.0070.00016.82
8.0.60.0070.00017.03
8.0.50.0040.00416.93
8.0.30.0110.01217.30
8.0.20.0130.01117.40
8.0.10.0030.00517.17
8.0.00.0100.00716.87
7.4.330.0030.00316.67
7.4.320.0070.00016.48
7.4.300.0030.00316.55
7.4.290.0000.00716.46
7.4.280.0030.00316.56
7.4.270.0000.00716.42
7.4.260.0030.00313.23
7.4.250.0050.00316.36
7.4.240.0080.00016.57
7.4.230.0000.00716.68
7.4.220.0060.01316.38
7.4.210.0070.01016.52
7.4.200.0050.00216.64
7.4.190.0030.00516.52
7.4.160.0120.00516.70
7.4.150.0180.00717.40
7.4.140.0060.01317.86
7.4.130.0110.00916.60
7.4.120.0090.00916.49
7.4.110.0150.00416.44
7.4.100.0130.00416.48
7.4.90.0150.01116.37
7.4.80.0140.00619.39
7.4.70.0050.01816.26
7.4.60.0100.00716.42
7.4.50.0030.00616.17
7.4.40.0120.00322.77
7.4.30.0110.00516.63
7.4.00.0030.01314.84
7.3.330.0050.00013.27
7.3.320.0020.00213.38
7.3.310.0000.00716.47
7.3.300.0030.00316.39
7.3.290.0030.01016.37
7.3.280.0080.00816.30
7.3.270.0040.01617.40
7.3.260.0110.01018.24
7.3.250.0110.01116.45
7.3.240.0030.01916.57
7.3.230.0140.00316.39
7.3.210.0060.01116.26
7.3.200.0090.01219.39
7.3.190.0180.00016.35
7.3.180.0090.00916.24
7.3.170.0070.01016.40
7.3.160.0090.00616.27
7.3.120.0000.01514.92
7.2.330.0060.01516.66
7.2.320.0040.01316.59
7.2.310.0160.00716.37
7.2.300.0100.00716.79
7.2.290.0000.01616.47
7.2.110.0090.00616.56
7.2.100.0260.00416.48
7.2.90.0160.00616.59
7.2.80.0160.00316.68
7.2.70.0150.00916.80
7.2.60.0290.00316.74
7.2.50.0190.00616.56
7.2.40.0120.00916.57
7.2.30.0130.00616.91
7.2.20.0240.00316.66
7.2.10.0130.01016.58
7.2.00.0100.01018.13
7.1.230.0230.00615.84
7.1.220.0130.00315.45
7.1.210.0150.00315.80
7.1.200.0120.00615.62
7.1.190.0110.00415.82
7.1.180.0140.00915.76
7.1.170.0130.00515.61
7.1.160.0180.00715.86
7.1.150.0220.00315.83
7.1.140.0100.00615.55
7.1.130.0090.00915.80
7.1.120.0130.00815.53
7.1.110.0060.01215.75
7.1.100.0070.00917.09
7.1.90.0250.00315.75
7.1.80.0180.00415.82
7.1.70.0100.00716.29
7.1.60.0130.01417.41
7.1.50.0180.01525.31
7.1.40.0310.00615.69
7.1.30.0190.00615.96
7.1.20.0230.00715.69
7.1.10.0150.00915.85
7.1.00.0070.02219.10
7.0.310.0110.00315.21
7.0.300.0240.00715.26
7.0.290.0180.00615.34
7.0.280.0190.00815.38
7.0.270.0160.00015.31
7.0.260.0050.01015.41
7.0.250.0170.00215.15
7.0.240.0260.00015.60
7.0.230.0190.01315.29
7.0.220.0240.00915.31
7.0.210.0120.00415.41
7.0.200.0240.00516.23
7.0.190.0130.00515.40
7.0.180.0210.00315.33
7.0.170.0100.00815.35
7.0.160.0210.00015.45
7.0.150.0160.00815.55
7.0.140.0070.03818.75
7.0.130.0110.00715.24
7.0.120.0220.01015.58
7.0.110.0120.00815.38
7.0.100.0070.05217.65
7.0.90.0150.04317.65
7.0.80.0140.04117.67
7.0.70.0170.03917.70
7.0.60.0150.04417.74
7.0.50.0160.02517.86
7.0.40.0080.04816.83
7.0.30.0150.03516.75
7.0.20.0120.04716.79
7.0.10.0150.03616.79
7.0.00.0060.04616.53
5.6.380.0120.00414.47
5.6.370.0140.00914.10
5.6.360.0100.00514.29
5.6.350.0100.01014.24
5.6.340.0170.00014.39
5.6.330.0100.00314.39
5.6.320.0030.01014.25
5.6.310.0140.00314.04
5.6.300.0100.00814.21
5.6.290.0040.01414.16
5.6.280.0070.03817.64
5.6.270.0140.00014.48
5.6.260.0150.00014.08
5.6.250.0090.04617.65
5.6.240.0040.04617.45
5.6.230.0120.02617.43
5.6.220.0110.04017.47
5.6.210.0070.04517.51
5.6.200.0110.02617.86
5.6.190.0140.04217.60
5.6.180.0100.04517.68
5.6.170.0140.03717.66
5.6.160.0100.03517.69
5.6.150.0130.04317.69
5.6.140.0060.04717.81
5.6.130.0100.04117.68
5.6.120.0150.04017.78
5.6.110.0140.04517.64
5.6.100.0200.03617.66
5.6.90.0120.04017.71
5.6.80.0100.02717.44
5.6.70.0130.03417.33
5.6.60.0080.04117.41
5.6.50.0110.03417.36
5.6.40.0130.04017.49
5.6.30.0130.01817.39
5.6.20.0120.04217.22
5.6.10.0150.04017.35
5.6.00.0050.04417.22
5.5.380.0130.03516.68
5.5.370.0090.04316.65
5.5.360.0050.04616.68
5.5.350.0120.04116.60
5.5.340.0050.03816.83
5.5.330.0040.04616.85
5.5.320.0070.04316.80
5.5.310.0100.02316.82
5.5.300.0090.04116.86
5.5.290.0120.04116.82
5.5.280.0090.04516.77
5.5.270.0150.03916.80
5.5.260.0100.02716.81
5.5.250.0110.03816.75
5.5.240.0130.03516.56
5.5.230.0170.03116.45
5.5.220.0150.03016.48
5.5.210.0080.03016.53
5.5.200.0100.03716.46
5.5.190.0080.04716.52
5.5.180.0080.04216.54
5.5.170.0140.00914.15
5.5.160.0060.04516.49
5.5.150.0070.02416.47
5.5.140.0090.03816.49
5.5.130.0070.02416.46
5.5.120.0120.02216.51
5.5.110.0090.03316.51
5.5.100.0090.02016.48
5.5.90.0070.01916.43
5.5.80.0060.02016.44
5.5.70.0040.02616.45
5.5.60.0070.02816.38
5.5.50.0060.02016.43
5.5.40.0070.04016.48
5.5.30.0090.03416.48
5.5.20.0050.03916.47
5.5.10.0070.02016.39
5.5.00.0080.02016.38
5.4.450.0050.04716.07
5.4.440.0100.03716.08
5.4.430.0060.04316.10
5.4.420.0040.04416.00
5.4.410.0050.04816.03
5.4.400.0050.02516.01
5.4.390.0110.03815.85
5.4.380.0130.03515.94
5.4.370.0040.03115.85
5.4.360.0070.02315.95
5.4.350.0040.03615.92
5.4.340.0080.02015.87
5.4.330.0070.00312.79
5.4.320.0110.03415.82
5.4.310.0100.01915.98
5.4.300.0130.02415.94
5.4.290.0050.02015.96
5.4.280.0040.02315.98
5.4.270.0130.02315.91
5.4.260.0090.02215.80
5.4.250.0050.02016.01
5.4.240.0070.02515.94
5.4.230.0020.02415.95
5.4.220.0080.04216.00
5.4.210.0100.03515.84
5.4.200.0100.03315.86
5.4.190.0080.02415.90
5.4.180.0070.03915.83
5.4.170.0050.03915.91
5.4.160.0000.02615.97
5.4.150.0030.03715.82
5.4.140.0060.02414.55
5.4.130.0070.02814.63
5.4.120.0070.01814.63
5.4.110.0050.02014.56
5.4.100.0020.02414.63
5.4.90.0090.01614.67
5.4.80.0040.02214.59
5.4.70.0020.02014.64
5.4.60.0060.02014.54
5.4.50.0080.02114.54
5.4.40.0080.01814.66
5.4.30.0000.02414.55
5.4.20.0050.02114.60
5.4.10.0060.04214.56
5.4.00.0040.02914.32
5.3.290.0080.02813.70
5.3.280.0070.02313.67
5.3.270.0050.02313.67
5.3.260.0040.02613.68
5.3.250.0030.02313.69
5.3.240.0080.01813.61
5.3.230.0060.02213.67
5.3.220.0050.02113.61
5.3.210.0070.02113.61
5.3.200.0090.01913.61
5.3.190.0080.02813.67
5.3.180.0050.01813.67
5.3.170.0070.01813.59
5.3.160.0000.02513.65
5.3.150.0080.01713.67
5.3.140.0080.02513.68
5.3.130.0040.02113.60
5.3.120.0020.02413.68
5.3.110.0060.01913.63
5.3.100.0070.01913.40
5.3.90.0090.01513.31
5.3.80.0080.01813.38
5.3.70.0070.02113.38
5.3.60.0080.01813.36
5.3.50.0040.02113.36
5.3.40.0070.01713.36
5.3.30.0040.02413.33
5.3.20.0020.02413.12
5.3.10.0060.01913.22
5.3.00.0050.02513.09
5.2.170.0030.01812.58
5.2.160.0030.02412.58
5.2.150.0040.03512.58
5.2.140.0050.01712.58
5.2.130.0050.01712.58
5.2.120.0030.01512.58
5.2.110.0030.01712.58
5.2.100.0040.01412.58
5.2.90.0050.01812.58
5.2.80.0040.01712.58
5.2.70.0020.03212.58
5.2.60.0050.02012.58
5.2.50.0060.03312.58
5.2.40.0060.02712.58
5.2.30.0090.03212.58
5.2.20.0070.02012.58
5.2.10.0090.01812.58
5.2.00.0050.02412.58
5.1.60.0040.02712.58
5.1.50.0080.02612.58
5.1.40.0090.02612.58
5.1.30.0020.03112.58
5.1.20.0020.03212.58
5.1.10.0030.02612.58
5.1.00.0070.02812.58
5.0.50.0020.02712.58
5.0.40.0000.02612.58
5.0.30.0060.03312.58
5.0.20.0050.02112.58
5.0.10.0030.02512.58
5.0.00.0040.02812.58
4.4.90.0000.01212.58
4.4.80.0050.01812.58
4.4.70.0020.01712.58
4.4.60.0020.01212.58
4.4.50.0050.00812.58
4.4.40.0060.02712.58
4.4.30.0060.01512.58
4.4.20.0030.01012.58
4.4.10.0030.01812.58
4.4.00.0050.02812.58
4.3.110.0050.01712.58
4.3.100.0030.01812.58
4.3.90.0020.01512.58
4.3.80.0070.02612.58
4.3.70.0020.01812.58
4.3.60.0010.01612.58
4.3.50.0000.01912.58
4.3.40.0030.02412.58
4.3.30.0070.01012.58
4.3.20.0020.02212.58
4.3.10.0030.02012.58
4.3.00.0040.01712.58

preferences:
40.21 ms | 400 KiB | 5 Q