Doc #51908 [Opn->Csd]: Undocumented return value for strtr
| From: | salathe@php.net | Date: | Fri, 28 May 2010 16:02:56 +0000 |
| Subject: | Doc #51908 [Opn->Csd]: Undocumented return value for strtr | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4468@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51908&edit=1
ID: 51908
Updated by: salathe@php.net
Reported by: tsteiner at nerdclub dot net
Summary: Undocumented return value for strtr
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Any
PHP Version: 5.3.2
-Assigned To:
+Assigned To: salathe
New Comment:
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.
I've added a note about the function returning false when an empty
string key is
provided. Thanks for the report!
Previous Comments:
------------------------------------------------------------------------
[2010-05-28 17:50:02] salathe@php.net
Automatic comment from SVN on behalf of salathe
Revision: http://svn.php.net/viewvc/?view=revision&revision=299913
Log: tidied up return values section for strtr()
- simpler normal return value description
- empty key returns false (bug #51908)
------------------------------------------------------------------------
[2010-05-25 21:14:16] tsteiner at nerdclub dot net
Description:
------------
If strtr(string $str, array $replace_pairs) is called and one of the
keys of $replace_pairs is an empty string, strtr will return the boolean
value FALSE. This is not reflected in the documentation.
Test script:
---------------
<?php
var_dump(strtr('foo', array('' => 'nothing')));
Expected result:
----------------
Unsure, is the empty string ever really "found" in a string?
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51908&edit=1