Bug #81505 [Com]: preg_match BC after apt-get upgrade
| From: | php at tim dot ainfach dot dq | Date: | Tue, 05 Oct 2021 10:18:44 +0000 |
| Subject: | Bug #81505 [Com]: preg_match BC after apt-get upgrade | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-237039@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81505&edit=1
ID: 81505
Comment by: php at tim dot ainfach dot dq
Reported by: php at tim dot ainfach dot de
Summary: preg_match BC after apt-get upgrade
Status: Open
Type: Bug
Package: *Regular Expressions
Operating System: OSX 10.14.6
PHP Version: 8.0.11
Block user comment: N
Private report: N
New Comment:
here is the complete output when running the command:
https://gist.github.com/timglabisch/75683af0250262a556cd0d694414a742
Previous Comments:
------------------------------------------------------------------------
[2021-10-05 10:16:09] php at tim dot ainfach dot de
Description:
------------
We have noticed that a test failed in our CI process. I guess its a BC in preg_match.
I am not 100% sure if it's related to php / ubuntu or ppa:ondrej/php but i guess a lot of
people are affected by this. We could also reproduce this issue on different servers and containers.
you can reproduce the issue in with docker. The only difference here is the apt-get upgrade. foo.php
is the example script.
docker run --rm -v "
pwd/foo.php:/foo.php" -it ubuntu:latest \
/bin/bash -c 'apt-get update && apt-get install software-properties-common -y
&& add-apt-repository ppa:ondrej/php && apt-get update && apt-get install -y
php8.0-cli && php -v && php /foo.php'
# array(3) {
# [0]=>
# string(19) "/348182/XXX_348102/"
# [1]=>
# string(6) "348182"
# [2]=>
# string(6) "348102"
# }
echo "now with upgrade"
# array(0) {
# }
docker run --rm -v "pwd/foo.php:/foo.php" -it ubuntu:latest \
/bin/bash -c 'apt-get update && apt-get install software-properties-common -y
&& add-apt-repository ppa:ondrej/php && apt-get update && apt-get upgrade
&& apt-get install -y php8.0-cli && php -v && php /foo.php'
Test script:
---------------
<?php
preg_match('/\/([\d]+)\/XXX_([\d]+)\//', '00/348/348182/XXX_348102/xxx',
$matches); var_dump($matches);
Expected result:
----------------
array(3) {
[0]=>
string(19) "/348182/XXX_348102/"
[1]=>
string(6) "348182"
[2]=>
string(6) "348102"
}
Actual result:
--------------
array(0) {
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81505&edit=1