Bug #78853 [Asn->Csd]: preg_match() may return integer > 1
| From: | cmb@php.net | Date: | Fri, 22 Nov 2019 18:31:34 +0000 |
| Subject: | Bug #78853 [Asn->Csd]: preg_match() may return integer > 1 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223862@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78853&edit=1
ID: 78853
Updated by: cmb@php.net
Reported by: cmb@php.net
Summary: preg_match() may return integer > 1
-Status: Assigned
+Status: Closed
Type: Bug
Package: PCRE related
Operating System: *
PHP Version: 7.3.12
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e1da72bdf18aa3d413c5324bccfd8dc521c217e3
Log: Fix #78853: preg_match() may return integer > 1
Previous Comments:
------------------------------------------------------------------------
[2019-11-21 11:51:48] cmb@php.net
Description:
------------
As of PHP 7.3.0, preg_match() may return an integer greater than
one on success[1], although the documentation states[2]:
| preg_match() returns 1 if the pattern matches given subject, [â¦]
This issue has been reported by Falko Matthies.
[1] <https://3v4l.org/cKarY>
[2] <https://www.php.net/manual/en/function.preg-match.php#refsect1-function.preg-match-returnvalues>
Test script:
---------------
var_dump(preg_match('/^|\d{1,2}$/', "7"));
Expected result:
----------------
int(1)
Actual result:
--------------
int(2)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78853&edit=1