Hi,

I found this issue related to the variable type after a if test:

<?php

declare(strict_types=1);

namespace Devsense\Builtin;

$result = preg_replace('/test/i', 'TEST', 'test');

if($result !== '') {
    /**
     * Must not raise PHP0406
     */
    $result = ucfirst($result);
}

/**
 * Result must not be a bool with PHP8.x
 */
$result = explode(',', '1,2,3');

You should have an error PHP0406.

Thank you for your fix.

    3 months later
    3 months later

    Jean-FrancoisHIVERT Thank you for reminding me, yes we have fixed part of the issue.

    I'll mark it as solved, although still explode() returns bool here which is unnecessary - working on it.

      Write a Reply...