DEVSENSE / phptools-docs

PHP Tools public content
Apache License 2.0
83 stars 10 forks source link

wrong assign type #717

Closed ging-dev closed 3 weeks ago

ging-dev commented 3 weeks ago
<?php

function a($a) {
    /** @var string */
    return $a ??= match ($b = 1) { // $a must be assign as string by @var string, but $b is affected.
        '' => 'foo',
        default => 'bar',
    };
}
jakubmisek commented 3 weeks ago

thanks! fixed