3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace { function callable_equals(){ $strict = false; $callables = func_get_args(); if(is_bool($args[count($callables) - 1])){ $strict = $args[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.0032.00018.43
8.3.50.0121.99121.91
8.3.40.0071.99918.79
8.3.30.0101.99319.17
8.3.20.0002.00220.16
8.3.10.0031.99921.94
8.3.00.0031.99819.50
8.2.180.0131.99018.21
8.2.170.0071.99722.96
8.2.160.0071.99720.52
8.2.150.0031.99924.18
8.2.140.0031.99924.66
8.2.130.0071.99626.16
8.2.120.0031.99819.66
8.2.110.0031.99920.43
8.2.100.0032.00017.75
8.2.90.0031.99819.35
8.2.80.0032.00217.97
8.2.70.0031.99917.75
8.2.60.0031.99717.93
8.2.50.0032.00618.07
8.2.40.0002.00118.28
8.2.30.0001.99918.13
8.2.20.0032.00017.91
8.2.10.0002.00118.28
8.2.00.0071.99417.89
8.1.280.0031.99925.92
8.1.270.0132.00620.82
8.1.260.0032.00026.35
8.1.250.0002.00328.09
8.1.240.0071.99623.92
8.1.230.0032.00119.15
8.1.220.0002.00417.79
8.1.210.0071.99418.77
8.1.200.0031.99617.48
8.1.190.0031.99817.35
8.1.180.0071.99718.10
8.1.170.0071.99520.45
8.1.160.0071.99622.16
8.1.150.0071.99919.02
8.1.140.0071.99417.38
8.1.130.0002.00117.82
8.1.120.0071.99517.44
8.1.110.0032.00017.43
8.1.100.0002.00417.46
8.1.90.0002.00417.57
8.1.80.0002.00217.49
8.1.70.0032.00017.40
8.1.60.0071.99517.65
8.1.50.0031.99817.63
8.1.40.0002.00417.57
8.1.30.0031.99817.63
8.1.20.0032.00017.64
8.1.10.0032.00017.59
8.1.00.0031.99917.48
8.0.300.0032.00018.77
8.0.290.0031.99816.75
8.0.280.0002.00118.39
8.0.270.0032.00217.28
8.0.260.0032.00117.26
8.0.250.0031.99916.81
8.0.240.0032.00016.88
8.0.230.0031.99916.93
8.0.220.0002.00216.90
8.0.210.0031.99916.92
8.0.200.0032.00016.82
8.0.190.0032.00016.79
8.0.180.0002.00116.90
8.0.170.0032.00016.90
8.0.160.0031.99916.92
8.0.150.0002.00416.80
8.0.140.0002.00216.89
8.0.130.1461.77613.41
8.0.120.0071.99416.78
8.0.110.0071.99716.89
8.0.100.0031.99916.75
8.0.90.0071.99516.96
8.0.80.0161.99116.80
8.0.70.0032.00116.75
8.0.60.0002.00316.91
8.0.50.0071.99716.79
8.0.30.0211.96616.98
8.0.20.0231.98217.40
8.0.10.0101.99317.04
8.0.00.0161.99716.72
7.4.330.0002.00115.03
7.4.320.0002.00316.41
7.4.300.0002.00216.39
7.4.290.0071.99516.54
7.4.280.0201.98316.36
7.4.270.0032.00016.45
7.4.260.0031.99816.43
7.4.250.0002.00316.48
7.4.240.0081.99516.51
7.4.230.0071.99616.23
7.4.220.0131.98616.60
7.4.210.0191.98116.40
7.4.200.0071.99716.43
7.4.160.0271.97716.48
7.4.150.0331.95417.40
7.4.140.0231.98617.86
7.4.130.0161.97716.42
7.4.120.0111.98816.52
7.4.110.0062.42416.55
7.4.100.0132.44116.33
7.4.90.0162.42116.45
7.4.80.0232.40019.39
7.4.70.0272.17516.45
7.4.60.0192.33616.45
7.4.50.0002.49916.36
7.4.40.0092.44516.53
7.4.30.0102.37416.29
7.4.00.0072.49115.13
7.3.330.0351.98613.51
7.3.320.0032.00113.46
7.3.310.0002.00216.30
7.3.300.0071.99616.33
7.3.290.0002.00316.20
7.3.280.0191.98816.34
7.3.270.0201.98617.40
7.3.260.0161.97116.25
7.3.250.0181.97616.42
7.3.240.0101.99716.57
7.3.230.0162.44816.55
7.3.210.0232.44016.61
7.3.200.0162.40919.39
7.3.190.0202.43416.29
7.3.180.0132.44716.41
7.3.170.0232.42716.52
7.3.160.0262.42516.36
7.2.330.0162.45016.46
7.2.320.0162.45016.63
7.2.310.0132.45716.61
7.2.300.0232.45116.77
7.2.290.0162.42416.42
7.2.60.0072.48616.89
7.2.00.0032.49819.44
7.1.200.0072.49115.87
7.1.100.0102.49118.04
7.1.70.0102.49116.63
7.1.60.0102.49119.50
7.1.50.0032.49817.08
7.1.00.0102.49022.24
7.0.200.0641.93714.84
7.0.140.0002.50022.02
7.0.60.0072.49319.97
7.0.50.0102.49017.85
7.0.40.0102.49019.85
7.0.30.0302.47019.81
7.0.20.0332.46719.79
7.0.10.0302.47019.69
7.0.00.0002.50019.94
5.6.280.0102.49021.06
5.6.210.0132.48720.72
5.6.200.0172.48318.18
5.6.190.0032.49720.48
5.6.180.0202.48020.41
5.6.170.0472.45320.41
5.6.160.0102.49020.47
5.6.150.0132.48718.18
5.6.140.0102.49018.16
5.6.130.0002.50018.20
5.6.120.0102.49021.04
5.6.110.0032.49721.15
5.6.100.0002.50021.16
5.6.90.0072.49320.99
5.6.80.0202.48020.40
5.6.70.0232.46020.42
5.5.350.0732.42720.48
5.5.340.0072.49317.97
5.5.330.0072.49320.22
5.5.320.0132.48720.18
5.5.310.0202.48020.22
5.5.300.0032.49717.94
5.5.290.0032.49717.98
5.5.280.0072.49320.90
5.5.270.0002.50020.82
5.5.260.0072.49320.98
5.5.250.0032.49720.60
5.5.240.0032.49720.37
5.4.450.0172.48019.41
5.4.440.0002.49719.38
5.4.430.0172.48019.38
5.4.420.0032.49319.27
5.4.410.0172.48018.98
5.4.400.0331.97718.50
5.4.390.0301.67318.70
5.4.380.0301.80718.71
5.4.370.0101.75018.60
5.4.360.0201.86018.76
5.4.350.0271.47718.73
5.4.340.0271.89019.29
5.4.320.0271.64318.66
5.4.310.0272.41718.77
5.4.300.0432.39318.57
5.4.290.0202.46319.56
5.4.280.0102.48318.76
5.4.270.0172.48018.59
5.4.260.0302.46718.69
5.4.250.0172.48018.73
5.4.240.0132.43018.48
5.4.230.0232.46318.68
5.4.220.0402.43018.68
5.4.210.0402.45318.47
5.4.200.0202.47316.64
5.4.190.0372.45718.68
5.4.180.0432.44018.46
5.4.170.0332.46318.47
5.4.160.0232.47318.71
5.4.150.0272.46318.77
5.4.140.0272.46716.29
5.4.130.0232.47316.27
5.4.120.0272.45316.23
5.4.110.0372.44316.23
5.4.100.0172.39316.18
5.4.90.0302.46016.29
5.4.80.0332.42716.42
5.4.70.0231.65716.18
5.4.60.0301.77316.43
5.4.50.0331.80316.25
5.4.40.0201.78016.44
5.4.30.0201.95016.21
5.4.20.0202.06016.21
5.4.10.0272.47016.27

preferences:
47.83 ms | 401 KiB | 5 Q