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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2026 The PHP Group
All rights reserved.
Last updated: Wed Jun 17 05:00:01 2026 UTC