php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #32201 gettext: Unexpected output from textdomain()
Submitted: 2005-03-06 02:58 UTC Modified: 2005-03-07 19:15 UTC
From: php at fimbul dot net Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.10 OS: Linux (Debian unstable)
Private report: No CVE-ID: None
 [2005-03-06 02:58 UTC] php at fimbul dot net
Description:
------------
From the documentation:
string textdomain ( string text_domain )

This function sets the domain to search within when calls are made to gettext(), usually the named after an application. The previous default domain is returned. Call it with NULL as parameter to get the current setting without changing it.

What actually happens:
This function sets the domain to search within when calls are made to gettext(), usually the named after an application. The current default domain is returned, i.e. the domain just set. Call it with NULL as parameter to get the current setting without changing it.

Reproduce code:
---------------
<?php
// Let's assume that the current default domain is 'A'
echo textdomain(NULL);
echo $orig = textdomain('B');
echo textdomain(NULL);
echo textdomain('C');
echo textdomain(NULL);
echo textdomain($orig);
echo textdomain(NULL);
?>


Expected result:
----------------
AABBCCA

Actual result:
--------------
ABBCCBB

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-06 15:40 UTC] sniper@php.net
From the GNU gettext manpage:

"If successful, the textdomain function returns the current 
message domain, after possibly changing it."

As the PHP function is merely a wrapper to this gettext function, this is a documentation problem. Reclassified as such.

 [2005-03-07 19:15 UTC] nlopess@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.


 [2020-02-07 06:11 UTC] phpdocbot@php.net
Automatic comment on behalf of nlopess
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=b09bba42b7677bd800bc5a8fdb8b8f1c0d263c1e
Log: fix #32201: fix return value convert to new doc style
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 22:01:26 2024 UTC