Bug #75089 [NEW]: preg_grep() is not reporting PREG_BAD_UTF8_ERROR
| From: | david at grudl dot com | Date: | Fri, 18 Aug 2017 07:56:28 +0000 |
| Subject: | Bug #75089 [NEW]: preg_grep() is not reporting PREG_BAD_UTF8_ERROR | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-210726@lists.php.net to get a copy of this message | ||
From: david at grudl dot com
Operating system:
PHP version: 7.2.0beta3
Package: PCRE related
Bug Type: Bug
Bug description:preg_grep() is not reporting PREG_BAD_UTF8_ERROR
Description:
------------
preg_grep() is not reporting PREG_BAD_UTF8_ERROR
test script: https://3v4l.org/3aY3r
Test script:
---------------
<?php
preg_grep('#\d#u', ['a', "1\xFF", 'c']); // array contains
invalid utf-8
string
var_dump(preg_last_error()); // returns PREG_BAD_UTF8_ERROR in PHP < 7.2
and 0 in PREG_NO_ERROR in PHP 7.2
Expected result:
----------------
PREG_BAD_UTF8_ERROR
Actual result:
--------------
PREG_NO_ERROR
--
Edit bug report at https://bugs.php.net/bug.php?id=75089&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75089&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75089&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75089&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75089&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75089&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75089&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75089&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75089&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75089&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75089&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75089&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75089&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75089&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75089&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75089&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75089&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75089&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75089&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75089&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75089&r=mysqlcfg