php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #48751 intl Locale::filterMatches wrong parameters and example
Submitted: 2009-07-01 07:48 UTC Modified: 2009-07-01 20:32 UTC
From: ladislav at marek dot su Assigned: stas (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ladislav at marek dot su
New email:
PHP Version: OS:

 

 [2009-07-01 07:48 UTC] ladislav at marek dot su
Description:
------------
Documentation says that Locale::filterMatches has two parameters, but reflection shows three:

Method [ <internal:intl> static public method filterMatches ] {

  - Parameters [3] {
    Parameter #0 [ <required> $arg1 ]
    Parameter #1 [ <required> $arg2 ]
    Parameter #2 [ <required> $arg3 ]
  }
}

And in OO example is used incorrect method name Locale::filter_matches instead of Locale::filterMatches.

http://docs.php.net/manual/en/locale.filtermatches.php

Reproduce code:
---------------
var_dump(Locale::filterMatches('de-DE-1996', 'de-DE'));

Expected result:
----------------
bool(%b)

Actual result:
--------------
Warning: Locale::filterMatches() expects exactly 3 parameters, 2 given in %s on line %n
bool(false) 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-01 11:26 UTC] bjori@php.net
By the looks of things, the 3rd argument (canonical) should be boolean (default to false)..

Stas: Could you update the locale_api.php and proto, and the arginfo+param parsing if I'm right?

 [2009-07-01 20:32 UTC] stas@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

fixed, thanks
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 00:00:02 2026 UTC