3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace { function callable_equals(){ $strict = false; $callables = func_get_args(); if(is_bool($callables[count($callables) - 1])){ $strict = $callables[count($callables) - 1]; $callables = array_splice($callables, 0, -1); } $normalizeCallable = function(callable $callable){ if(is_string($callable)){ $callable = strtolower($callable); $pieces = explode("::", $callable); if(count($pieces) == 2){ return [$pieces[0], $pieces[1]]; } return $callable; } if(is_string($callable[0])){ $callable[0] = strtolower($callable[0]); } $callable[1] = strtolower($callable[1]); return $callable; }; if(count($callables) < 2){ trigger_error("callable_equals() requires at least 2 callables for comparison.", E_USER_WARNING); return null; } foreach($callables as $i => $callable){ if(!is_callable($callable)){ trigger_error("Argument " . ($i + 1) . " is not a callable.", E_USER_WARNING); return null; }else{ $callables[$i] = $normalizeCallable($callable); } } $callable = array_shift($callables); while($callables){ if($callable !== $callables[0]) return false; } return true; } class Foo{static function bar(){}} } namespace A\b\C\d { class Foo{static function bar(){}} } namespace { var_dump(callable_equals( ['Foo', 'bar'], 'foo::BAR' )); var_dump(callable_equals( ['A\\b\\C\\d\\Foo', 'bAr'], 'a\\B\\c\\D\\FoO::bar' )); }

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.0171.98518.30
8.3.50.0101.99222.06
8.3.40.0032.00018.67
8.3.30.0071.99719.01
8.3.20.0071.99420.16
8.3.10.0071.99621.95
8.3.00.0071.99719.16
8.2.180.0071.99518.16
8.2.170.0101.99322.96
8.2.160.0071.99620.39
8.2.150.0071.99524.18
8.2.140.0071.99624.66
8.2.130.0032.00126.16
8.2.120.0071.99619.66
8.2.110.0032.00119.10
8.2.100.0071.99517.63
8.2.90.0032.00119.34
8.2.80.0031.99817.97
8.2.70.0032.00017.38
8.2.60.0071.99818.16
8.2.50.0002.00218.07
8.2.40.0032.00019.88
8.2.30.0031.99818.20
8.2.20.0031.99817.95
8.2.10.0002.00218.22
8.2.00.0031.99717.75
8.1.280.0101.99425.92
8.1.270.0002.00320.78
8.1.260.0002.00426.35
8.1.250.0002.00228.09
8.1.240.0101.99223.88
8.1.230.0071.99517.48
8.1.220.0031.99917.79
8.1.210.0071.99518.77
8.1.200.0071.99517.36
8.1.190.0032.00117.23
8.1.180.0002.00418.10
8.1.170.0032.00120.25
8.1.160.0002.00222.14
8.1.150.0101.99019.03
8.1.140.0032.00017.53
8.1.130.0002.00817.97
8.1.120.0071.99617.43
8.1.110.0032.00117.52
8.1.100.0002.00217.49
8.1.90.0031.99917.55
8.1.80.0002.00217.37
8.1.70.0071.99517.46
8.1.60.0031.99617.63
8.1.50.0002.00217.43
8.1.40.0031.99717.53
8.1.30.0071.99617.73
8.1.20.0171.98317.62
8.1.10.0031.99917.54
8.1.00.0031.99917.50
8.0.300.0002.00218.77
8.0.290.0031.99916.63
8.0.280.0031.99818.46
8.0.270.0031.99917.21
8.0.260.0032.00017.26
8.0.250.0031.99816.95
8.0.240.0071.99516.88
8.0.230.0031.99816.98
8.0.220.0002.00316.71
8.0.210.0032.00316.74
8.0.200.0032.00016.74
8.0.190.0031.99916.93
8.0.180.0032.00016.95
8.0.170.0071.99716.85
8.0.160.0002.00216.96
8.0.150.0002.00216.90
8.0.140.0032.00016.82
8.0.130.0101.99113.36
8.0.120.0031.99916.78
8.0.110.0002.00416.84
8.0.100.0031.99916.82
8.0.90.0032.00016.74
8.0.80.0161.98116.79
8.0.70.0032.00016.75
8.0.60.0031.99916.74
8.0.50.0101.99416.96
8.0.30.0171.98016.85
8.0.20.0431.95517.40
8.0.10.0071.99716.83
8.0.00.0141.99816.71
7.4.330.0002.00515.03
7.4.320.0002.00416.37
7.4.300.0031.99916.55
7.4.290.0031.99816.52
7.4.280.0002.00216.57
7.4.270.0002.00316.41
7.4.260.0071.99616.38
7.4.250.0002.00316.45
7.4.240.0022.00216.37
7.4.230.0031.99916.24
7.4.220.0061.99416.46
7.4.210.0031.99916.48
7.4.200.0031.99916.34
7.4.160.0401.95616.57
7.4.150.0062.00217.40
7.4.140.0151.97717.86
7.4.130.0181.98316.55
7.4.120.0102.00016.36
7.4.110.0162.43316.28
7.4.100.0162.43016.42
7.4.90.0102.45616.45
7.4.80.0292.37419.39
7.4.70.0462.17616.44
7.4.60.0102.46116.24
7.4.50.0032.49616.32
7.4.40.0162.41716.53
7.4.30.0132.42316.59
7.4.00.0032.49514.74
7.3.330.0461.93313.18
7.3.320.0032.00513.21
7.3.310.0002.00416.35
7.3.300.0002.00316.22
7.3.290.0101.99316.35
7.3.280.0301.91516.29
7.3.270.0071.99117.40
7.3.260.0072.00016.25
7.3.250.0051.99616.39
7.3.240.0161.98516.31
7.3.230.0192.41216.39
7.3.210.0102.46816.29
7.3.200.0132.43619.39
7.3.190.0162.45916.39
7.3.180.0162.46116.61
7.3.170.0102.44416.44
7.3.160.0072.46216.18
7.2.330.0322.40516.63
7.2.320.0032.46416.77
7.2.310.0032.45416.75
7.2.300.0262.39016.55
7.2.290.0162.45316.73
7.2.60.0032.49316.55
7.2.00.0032.49819.38
7.1.200.0072.48515.53
7.1.100.0102.49118.03
7.1.70.0002.50116.63
7.1.60.0072.49519.50
7.1.50.0102.49217.07
7.1.00.0032.49722.28
7.0.200.0542.12114.92
7.0.140.0072.49322.11
7.0.60.0102.49019.83
7.0.50.0102.49017.86
7.0.40.0032.49719.71
7.0.30.0402.46019.84
7.0.20.0272.47319.69
7.0.10.2802.22019.94
7.0.00.0072.49319.80
5.6.280.0102.49020.91
5.6.210.0072.49320.76
5.6.200.0132.48718.14
5.6.190.0072.49320.21
5.6.180.0272.47320.39
5.6.170.0302.47020.45
5.6.160.0032.49720.41
5.6.150.0072.47318.14
5.6.140.0132.48718.16
5.6.130.0102.49018.20
5.6.120.0032.49721.01
5.6.110.2032.29720.91
5.6.100.0102.49021.01
5.6.90.0072.49321.12
5.6.80.0002.50020.31
5.5.350.0202.48020.37
5.5.340.0072.49317.96
5.5.330.0032.49720.04
5.5.320.0132.48720.18
5.5.310.0332.46720.14
5.5.300.0072.49317.97
5.5.290.0102.49017.95
5.5.280.0102.49020.79
5.5.270.0102.49020.67
5.5.260.0132.48720.66
5.5.250.0132.48720.71
5.5.240.0102.49020.17
5.4.450.0102.48719.35
5.4.440.0002.49719.26
5.4.430.0202.47719.37
5.4.420.0072.49019.27
5.4.410.0232.47319.25
5.4.400.0232.47318.53
5.4.390.0272.47018.70
5.4.380.0432.44018.52
5.4.370.0372.45018.66
5.4.360.0372.45718.64
5.4.350.0502.41318.70
5.4.340.0332.46018.70
5.4.320.0332.46018.57
5.4.310.0372.44318.57
5.4.300.0302.45018.49
5.4.290.0302.44318.61
5.4.280.0302.46018.69
5.4.270.0272.45318.54
5.4.260.0232.47018.56
5.4.250.0332.45718.69
5.4.240.0432.43718.51
5.4.230.0432.44018.69
5.4.220.0302.44718.74
5.4.210.0332.46018.68
5.4.200.0302.33316.52
5.4.190.0201.43318.50
5.4.180.0231.32318.68
5.4.170.0271.63318.57
5.4.160.0231.64018.55
5.4.150.0201.64318.64
5.4.140.0131.41316.32
5.4.130.0131.55716.30
5.4.120.0131.95716.25
5.4.110.0271.67016.33
5.4.100.0171.87716.15
5.4.90.0371.83716.45
5.4.80.0172.23316.17
5.4.70.0232.46716.21
5.4.60.0232.47316.43
5.4.50.0272.47016.41
5.4.40.0272.47316.22
5.4.30.0202.47316.26
5.4.20.0272.47016.15
5.4.10.0402.45716.24

preferences:
47.16 ms | 401 KiB | 5 Q