Closed holtkamp closed 3 years ago
Thank you for raising this. I'll investigate this today.
I've introduced a specific test for the Assertion::url('http://www.domain.ext')
against PHP 7.3.0, 7.3.1, and 7.3.2.
Tests seem to pass (once I limited the PHPUnit to < V8).
I've no real problem limiting a pre-existing version if it is not forward compatible.
But I think I'll probably leave it as it is as I don't want to maintain multiple versions simultaneously.
Yeah, that would require a branch right?
https://github.com/beberlei/assert/issues/275#issuecomment-465084916
Did you manage to reproduce the problem of beberlei/assert 2.x
@ php 7.3
? In that case, maybe a warning in the documentation / changelog suffices...
Replicated : https://travis-ci.org/beberlei/assert/jobs/495412967#L902 preg_match(): Compilation failed: invalid range in character class at offset 187
https://github.com/symfony/validator/commit/ea91e49c40a943fd44bf515397dd4d88e0fd1374 is the fix.
I'll branch V2 and do a new release.
Ok, good to hear it can be replicated. PCRE2 is a bit stricter when dealing with the regular expressions:
https://wiki.php.net/rfc/pcre2-migration https://ayesh.me/Upgrade-PHP-7.3#pcre2
kudos for the swift response!
It was a bug in the original Symfony regex that I copied and updated later in V3.
@rquadling thanks for the fix! Do you know which branch/release to use?
@rquadling Ah I see, it should have been 2.9.7
but that's not released. The builds failed here https://github.com/beberlei/assert/commits/v2. Looks like phpstan failed, but I don't see it related to the code changes.
@adri, can you upgrade to V3?
For version
beberlei/assert 2.9.6
,Assertion::url('http://www.domain.ext');
fails on PHP7.3.2
, while it worked on7.1
.Any idea what the cause is of this? Does PHP
7.3.2
interpret the regular expression differently?Is that the reason why the regular expression was changed as mentioned here: https://github.com/beberlei/assert/issues/263 and documented here: https://github.com/beberlei/assert/blob/master/CHANGELOG.md#301---2018-07-04
I suppose this might be due to the upgrade to from PCRE to PCRE2 in PHP 7.3...
An upgrade to
beberlei/assert 3.2.0
resolved this issue.Maybe the
2.x
versions should requirePHP < 7.3
. Not sure whether changing that "backwards" is a back practice though 😄