#36307 [Opn->Csd]: array_search() - wrong version info in Polish docs
| From: | leszek@php.net | Date: | Tue, 07 Feb 2006 11:19:03 +0000 |
| Subject: | #36307 [Opn->Csd]: array_search() - wrong version info in Polish docs | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969371840@lists.php.net to get a copy of this message | ||
ID: 36307
Updated by: leszek@php.net
Reported By: xjd at wp dot pl
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Irrelevant
PHP Version: Irrelevant
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.
Previous Comments:
------------------------------------------------------------------------
[2006-02-06 21:22:57] xjd at wp dot pl
Description:
------------
The Polish doc page (
http://www.php.net/manual/pl/function.array-search.php
) says that
returned value (if search didn't find anything) is NULL _starting_ from
PHP 4.1.2, while the English one says that function returns NULL _prior_
to PHP 4.2.0.
[EN:] Note: Prior to PHP 4.2.0, array_search() returns NULL on failure
instead of FALSE.
[PL:] Notatka: Począwszy od PHP 4.1.2, array_search() zwraca NULL
w przypadku niepowodzenia zamiast FALSE
It looks to me like the first (English) one is correct. Below is a
simple test script.
Also, in Polish doc there is different version number but I cannot
confirm which is proper (I guess the one in English doc).
Reproduce code:
---------------
<?php
echo 'Current PHP version: ' . phpversion() . "\n";
$arr = array('the', 'show', 'must', 'go', 'on');
$result = array_search('bleah', $arr);
if ($result === FALSE) {
echo 'search result: FALSE';
} else if ($result === NULL) {
echo 'search result: NULL';
} else {
echo 'search result: "bleah" was found';
}
?>
Expected result:
----------------
/** according to Polish doc **/
Current PHP version: 5.0.4
search result: NULL
Actual result:
--------------
Current PHP version: 5.0.4
search result: FALSE
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36307&edit=1