-
-
Notifications
You must be signed in to change notification settings - Fork 930
Closed
Labels
Description
Feature request
This code is invalid in PHP 8.3 and PHPStan does not detect the problem:
<?php declare(strict_types = 1);
enum Language: string
{
case ENG = 'eng';
case FRE = 'fre';
case GER = 'ger';
case ITA = 'ita';
case SPA = 'spa';
case DUT = 'dut';
case DAN = 'dan';
}
$langs = [
Language::ENG,
Language::GER,
Language::DAN,
];
$result = array_diff($langs, [Language::DAN]);
(see https://phpstan.org/r/e1eb2d34-a57d-4e3e-b775-d6beca79ff39)
None of the arguments of array_diff
may contain arrays of enums.
Somewhat similar to #11111.
Did PHPStan help you today? Did it make you happy in any way?
No response