Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass 0 instead of null to preg_match() $flags, since in PHP 8.1+ the signature may change #87

Merged
merged 1 commit into from
Jun 17, 2021

Conversation

derrabus
Copy link
Contributor

@derrabus derrabus commented Jun 5, 2021

Q A
Documentation no
Bugfix yes
BC Break no
New Feature no
RFC no
QA no

Description

The $flags parameter of preg_match() should be an integer, but DocBlockScanner passes null when calling the method. PHP 8.1 will be stricter about that and trigger a deprecation warning. This PR proposes to pass 0 instead, which is the actual default value of that parameter.

Signed-off-by: Alexander M. Turek <me@derrabus.de>
@Ocramius
Copy link
Member

Ocramius commented Jun 5, 2021 via email

@Ocramius Ocramius self-assigned this Jun 17, 2021
@Ocramius Ocramius changed the base branch from 4.3.x to 4.4.x June 17, 2021 13:39
@Ocramius Ocramius added this to the 4.4.0 milestone Jun 17, 2021
@Ocramius Ocramius changed the title Pass 0 instead of null to preg_match() Pass 0 instead of null to preg_match() $flags, since in PHP 8.1+ the signature may change Jun 17, 2021
@Ocramius Ocramius merged commit 2b0bb59 into laminas:4.4.x Jun 17, 2021
@Ocramius
Copy link
Member

Thanks @derrabus!

@derrabus derrabus deleted the bugfix/preg-match-null-flags branch June 17, 2021 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants