|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2021-06-03 14:19 UTC] rlanting at move4mobile dot com
Description: ------------ This week I updated php and pcre through homebrew. As a result I got pcre2 10.37. For that specific version preg_match doesn't work as expected. Reverting only pcre2 to 10.36 makes it work again. The regex originates from https://github.com/phpspec/phpspec/blob/eb0d939b235f6091a8439a2a2fc144c9e0d5f569/src/PhpSpec/CodeAnalysis/TokenizedNamespaceResolver.php#L119 Homebrew issue: https://github.com/Homebrew/homebrew-core/issues/78635 Test script: --------------- <?php $matches = []; $test = ' App\Domain\Repository\MetaData\SomethingRepositoryInterface'; preg_match('/\\\\([^\\\\]+)\s*$/', $test, $matches); var_dump($matches); $test2 = ' App\Domain\Exception\NotFoundException'; preg_match('/\\\\([^\\\\]+)\s*$/', $test2, $matches); var_dump($matches); Expected result: ---------------- array(2) { [0]=> string(29) "\SomethingRepositoryInterface" [1]=> string(28) "SomethingRepositoryInterface" } array(2) { [0]=> string(18) "\NotFoundException" [1]=> string(17) "NotFoundException" } Actual result: -------------- array(0) { } array(2) { [0]=> string(18) "\NotFoundException" [1]=> string(17) "NotFoundException" } PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 19:00:01 2025 UTC |
As a simple thing to check, please could you set ini_set("pcre.jit", "0"); to see if that makes any difference on the broken version.