Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Don't let A & B be null when an empty array is passed#15

Open
niekp wants to merge 1 commit into
phpspec:masterphpspec/php-diff:masterfrom
niekp:hotfix/php-8-exceptionniekp/php-diff:hotfix/php-8-exceptionCopy head branch name to clipboard
Open

Don't let A & B be null when an empty array is passed#15
niekp wants to merge 1 commit into
phpspec:masterphpspec/php-diff:masterfrom
niekp:hotfix/php-8-exceptionniekp/php-diff:hotfix/php-8-exceptionCopy head branch name to clipboard

Conversation

@niekp
Copy link
Copy Markdown

@niekp niekp commented Mar 27, 2023

When passing an empty array to Diff the setSeq1 and setSeq2 check on null == [] will pass and a & b stay null.

This will cause an exception in getMatchingBlocks's count($this->a) on PHP 8.

In PHP 7.4 the count could handle null, but not anymore.
https://www.php.net/manual/en/function.count.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.