Problem:

Phan tool reported SEVERITY_CRITICAL issue:
- PhanTypeMismatchArgumentInternalReal. Line 1268 in advagg/advagg.inc: "Argument 3 ($limit) is NULL of type null but \preg_split() takes int"

Steps to reproduce:

run Phan tool ('minimum_target_php_version' => '8.0')

Proposed resolution:

Replace NULL to 0 for input parameter $limit of integer type in preg_split() .

CommentFileSizeAuthor
#2 advagg-3275028-php8-compability.patch542 bytesalena_stanul

Comments

alena_stanul created an issue. See original summary.

alena_stanul’s picture

Issue summary: View changes
StatusFileSize
new542 bytes
alena_stanul’s picture

alena_stanul’s picture

avpaderno’s picture

Title: PHP8 compatibility. Arguments preg_split() do not match required types. » Arguments passed to preg_split() do not match the required types
Version: 7.x-2.35 » 7.x-2.x-dev
Issue tags: -PHP8.0, -PHP8.1 +PHP 8.1
alena_stanul’s picture

Title: Arguments passed to preg_split() do not match the required types » Static call to non-static method
Issue summary: View changes
avpaderno’s picture

Status: Needs review » Reviewed & tested by the community

The third argument passed to preg_split() has always been an integer. Passing NULL worked so far because PHP converted it to 0, but PHP 8.1 stopped to make implicit conversions (and it stopped accepting them).

damienmckenna’s picture

Making the patch file visible again.

  • poker10 committed 700a0098 on 7.x-2.x authored by alena_stanul
    Issue #3275028 by alena_stanul: Arguments passed to preg_split() do not...
poker10’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.