php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #44765 Wrong return type
Submitted: 2008-04-17 18:51 UTC Modified: 2008-04-17 19:34 UTC
From: php at htmlland dot net Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php at htmlland dot net
New email:
PHP Version: OS:

 

 [2008-04-17 18:51 UTC] php at htmlland dot net
Description:
------------
The return value found in the description section on the documentation pages for preg_match and preg_match_all say int but then the "Return Values" box sates on-error FALSE will be returned.

The type needs to be changed to mixed and a warning box shown describing the diffrence between == and ===. See the documentation for array_search (the return values section).



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-17 19:12 UTC] colder@php.net
We don't document types returned in case of errors or function misuses, so "int" is fine here.

As for the == vs. === distinction, it doesn't make much sense here as 0 and false don't have radically different meanings nor would lead to false negatives.

In case of error, a warning is issued anyway.
 [2008-04-17 19:34 UTC] php at htmlland dot net
My bad :P thanks, Michael
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 24 05:01:32 2024 UTC