php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #51539 Undocumented idn_to_ascii behaviour and availability
Submitted: 2010-04-12 11:12 UTC Modified: 2010-10-25 18:13 UTC
From: tokul at users dot sourceforge dot net Assigned: philip (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tokul at users dot sourceforge dot net
New email:
PHP Version: OS:

 

 [2010-04-12 11:12 UTC] tokul at users dot sourceforge dot net
Description:
------------
PHP intl extension manual (http://www.php.net/manual/en/ref.intl.idn.php) does not say that idn_to_utf8() and idn_to_ascii() functions are available in PECL IDN extension on older PHP versions.

"PHP 5 >= 5.3.0, PECL intl >= 1.0.2" is unclear. Is it PHP 5.3.0+ AND intl 1.0.2+ extension or PHP 5.3.0+ OR intl 1.0.2+ extension.

Documentation states that function returns string, but idn_to_ascii() can also return boolean false on failure. (Tested on PHP 5.2.9 with intl 1.1.1 extension)

Test script:
---------------
var_dump(idn_to_ascii("\xa0.org"));


Actual result:
--------------
bool(false)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-10 07:43 UTC] philip@php.net
-Status: Open +Status: Feedback
 [2010-08-10 07:43 UTC] philip@php.net
Because intl is bundled with PHP as of 5.3.0, I think it's fairly clear. How would 
you suggest it be clearer? Keeping in mind that this format is used throughout the 
manual.

As for return value, I agree, it should be updated.
 [2010-08-11 15:21 UTC] tokul at users dot sourceforge dot net
-Status: Feedback +Status: Open
 [2010-08-11 15:21 UTC] tokul at users dot sourceforge dot net
IMHO documentation does not say that extension is bundled with PHP from some version. If that's default format of your docs, it is way too laconic for API documentation.

If you think that this version thing is correct, fine. But boolean false on failure should be noted in documentation.
 [2010-08-11 19:53 UTC] philip@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: philip
 [2010-08-11 19:53 UTC] philip@php.net
You're right, the "bundled with 5.3+" part is not documented well [for intl] so 
also needs improvement.
 [2010-10-25 18:03 UTC] philip@php.net
Automatic comment from SVN on behalf of philip
Revision: http://svn.php.net/viewvc/?view=revision&revision=304877
Log: Clarified pecl vs bundled version info, including --enable-intl. Deals with PHP bug #51539
 [2010-10-25 18:11 UTC] philip@php.net
Automatic comment from SVN on behalf of philip
Revision: http://svn.php.net/viewvc/?view=revision&revision=304879
Log: Mention pecl/idn version numbers where appropriate. Deals with PHP bug #51539
 [2010-10-25 18:12 UTC] philip@php.net
Automatic comment from SVN on behalf of philip
Revision: http://svn.php.net/viewvc/?view=revision&revision=304880
Log: Added that these return false on failure. Deals with and closes PHP bug #51539
 [2010-10-25 18:13 UTC] philip@php.net
-Status: Verified +Status: Closed
 [2010-10-25 18:13 UTC] philip@php.net
Fixed in SVN, thanks for the report :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 02:01:33 2024 UTC