Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50108 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29051 invoked from network); 5 Nov 2010 20:04:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2010 20:04:22 -0000 Authentication-Results: pb1.pair.com header.from=greno@verizon.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=greno@verizon.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain verizon.net designates 206.46.173.5 as permitted sender) X-PHP-List-Original-Sender: greno@verizon.net X-Host-Fingerprint: 206.46.173.5 vms173005pub.verizon.net Solaris 10 1203 Received: from [206.46.173.5] ([206.46.173.5:38074] helo=vms173005pub.verizon.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/54-03924-54364DC4 for ; Fri, 05 Nov 2010 15:04:22 -0500 Received: from [192.168.1.46] ([unknown] [72.91.189.24]) by vms173005.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LBF00KYCH2VGKO2@vms173005.mailsrvcs.net> for internals@lists.php.net; Fri, 05 Nov 2010 15:04:08 -0500 (CDT) Message-ID: <4CD463AB.2090702@verizon.net> Date: Fri, 05 Nov 2010 16:06:03 -0400 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 MIME-version: 1.0 To: internals@lists.php.net Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 7bit Subject: php gettext bindtextdomain behavior From: greno@verizon.net (Gerry Reno) In PHP 5.2.4 (my version) the gettext bindtextdomain function is not returning the existing directory settings when the directory argument is NULL. That is the expected behavior for bindtextdomain with GNU and it works this way elsewhere such as in python. PYTHON EXAMPLE: bindtextdomain("messages", "./locale"); textdomain("messages"); print bindtextdomain("messages",None); print textdomain(None); ACTUAL: (correct) # python test.py ./locale messages With PHP what happens is that is just returns the current directory rather than the existing bindtextdomain directory setting. PHP EXAMPLE: bindtextdomain("messages", "./locale"); textdomain("messages"); print bindtextdomain("messages",NULL)."\n"; print textdomain(NULL)."\n"; ACTUAL: (incorrect) # php test.php /var/www/htdocs messages EXPECTED: # php test.php ./locale messages Can PHP gettext bindtextdomain be fixed to correctly return the existing setting when called with a NULL directory argument? I was not sure if this was a bug so I thought I would present the issue on the internal list first.