|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2017-04-17 06:59 UTC] krakjoe@php.net
[2017-04-17 06:59 UTC] krakjoe@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 07:00:02 2025 UTC |
Description: ------------ All optional parameters of the Locale class are described as required by reflection. Test script: --------------- <?php $methods = [ 'getDefault', 'acceptFromHttp', 'canonicalize', 'composeLocale', 'getAllVariants', 'getKeywords', 'getPrimaryLanguage', 'getRegion', 'getScript', 'parseLocale', 'setDefault', 'getDisplayLanguage', 'getDisplayName', 'getDisplayRegion', 'getDisplayScript', 'getDisplayVariant', 'filterMatches', 'lookup', ]; foreach ($methods as $method) { $rm = new ReflectionMethod(Locale::class, $method); printf("%s: %d, %d\n", $method, $rm->getNumberOfParameters(), $rm->getNumberOfRequiredParameters()); } Expected result: ---------------- getDefault: 0, 0 acceptFromHttp: 1, 1 canonicalize: 1, 1 composeLocale: 1, 1 getAllVariants: 1, 1 getKeywords: 1, 1 getPrimaryLanguage: 1, 1 getRegion: 1, 1 getScript: 1, 1 parseLocale: 1, 1 setDefault: 1, 1 getDisplayLanguage: 2, 1 getDisplayName: 2, 1 getDisplayRegion: 2, 1 getDisplayScript: 2, 1 getDisplayVariant: 2, 1 filterMatches: 3, 2 lookup: 4, 2 Actual result: -------------- getDefault: 0, 0 acceptFromHttp: 1, 1 canonicalize: 1, 1 composeLocale: 1, 1 getAllVariants: 1, 1 getKeywords: 1, 1 getPrimaryLanguage: 1, 1 getRegion: 1, 1 getScript: 1, 1 parseLocale: 1, 1 setDefault: 1, 1 getDisplayLanguage: 2, 2 getDisplayName: 2, 2 getDisplayRegion: 2, 2 getDisplayScript: 2, 2 getDisplayVariant: 2, 2 filterMatches: 3, 3 lookup: 4, 4