Skip to content

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

Open
niekp wants to merge 1 commit intophpspec:masterfrom
niekp:hotfix/php-8-exception
Open

Don't let A & B be null when an empty array is passed#15
niekp wants to merge 1 commit intophpspec:masterfrom
niekp:hotfix/php-8-exception

Conversation

@niekp
Copy link

@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