Skip to content

Error when not checking the count argument is an array #60

@nasri-lab

Description

@nasri-lab

PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /Diff/SequenceMatcher.php:353

$aLength = count($this->a);
$bLength = count($this->b);

Please fix by replacing with this :

$aLength = is_array($this->a) ? count($this->a) : 0;
$bLength = is_array($this->b) ? count($this->b) : 0;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions