php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #36307 array_search() - wrong version info in Polish docs
Submitted: 2006-02-06 21:22 UTC Modified: 2006-02-07 12:19 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: xjd at wp dot pl Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
 [2006-02-06 21:22 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-07 12:19 UTC] leszek@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-12-30 10:43 UTC] nikic@php.net
Automatic comment on behalf of leszek
Revision: http://git.php.net/?p=doc/pl.git;a=commit;h=ff88f4c1e443fbc6b8a6c5a811fc44637cc62981
Log: - fixed bug #36307
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Nov 19 20:00:01 2025 UTC