php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #44506 nl_langinfo()
Submitted: 2008-03-22 21:38 UTC Modified: 2008-03-25 11:28 UTC
From: jo at feuersee dot de Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.2.5 OS: Linux
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: jo at feuersee dot de
New email:
PHP Version: OS:

 

 [2008-03-22 21:38 UTC] jo at feuersee dot de
Description:
------------
The documentation states that "item may be an integer value of the 
element or the constant name of the element."
The 2nd way (passing the const name as a string) doesn't work, the 
returned string will always be empty ("").
This may be a documentation bug.

Reproduce code:
---------------
jo@l33t ~> php5 -r '$l = setlocale(LC_ALL, "de_DE.utf8"); printf("%s: %s\n", $l, nl_langinfo(D_T_FMT));'
de_DE.utf8: %a %d %b %Y %T %Z
jo@l33t ~> php5 -r '$l = setlocale(LC_ALL, "de_DE.utf8"); printf("%s: %s\n", $l, nl_langinfo("D_T_FMT"));'
de_DE.utf8:


Expected result:
----------------
Both ways return
de_DE.utf8: %a %d %b %Y %T %Z

Actual result:
--------------
Only when using the D_T_FMT const, the result is like expected.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-25 11:28 UTC] felipe@php.net
The documentation says "constant name of the element", isn't "string of constant name ...".

Thanks.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Dec 05 00:00:01 2025 UTC