Bug #77726 [NEW]: Warning: preg_match(): Null byte in regex

From: Date: Tue, 12 Mar 2019 07:42:54 +0000
Subject: Bug #77726 [NEW]: Warning: preg_match(): Null byte in regex
Groups: php.standards 
Request: Send a blank email to standards-+get-1413@lists.php.net to get a copy of this message
From: 605036592 at qq dot com Operating system: CentOS-7.4-x86_64 PHP version: 7.2.16 Package: PHP Language Specification Bug Type: Bug Bug description:Warning: preg_match(): Null byte in regex Description: ------------ when I use preg_match pattern 0x0, Warning: preg_match(): Null byte in regex regex has match all character, why php not allow 0x0? it's a bug or has any reason? Test script: --------------- preg_match("/a".chr(0)."bc/", 'abc'); Expected result: ---------------- I expect preg_match right return 0 or 1 and not warning Actual result: -------------- Warning: preg_match(): Null byte in regex -- Edit bug report at https://bugs.php.net/bug.php?id=77726&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77726&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77726&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77726&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77726&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77726&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77726&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77726&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77726&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77726&r=support Expected behavior: https://bugs.php.net/fix.php?id=77726&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77726&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77726&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77726&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77726&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77726&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77726&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77726&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77726&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77726&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77726&r=mysqlcfg

« previous php.standards (#1413) next »