php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #60952 preg_match documentation mistake
Submitted: 2012-02-02 08:02 UTC Modified: 2012-02-02 08:07 UTC
From: thorne51 at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.3.9 OS: Windows
Private report: No CVE-ID: None
 [2012-02-02 08:02 UTC] thorne51 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.preg-match#refsect1-function.preg-
match-description
---
according to the documentation, preg_match returns a value of int, although it 
actually returns an array.

Test script:
---------------
var_dump(preg_match('/[0-9]/','5'));

Expected result:
----------------
Please update documentation


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-02 08:07 UTC] aharvey@php.net
No, preg_match() always returns an integer or false. The documentation is correct.
 [2012-02-02 08:07 UTC] aharvey@php.net
-Status: Open +Status: Not a bug -Package: *General Issues +Package: Documentation problem
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 14:00:02 2026 UTC