MIR0303
DuplicateArrayKey
An array literal contains duplicate keys. In PHP, when duplicate keys exist, later values overwrite earlier ones, which may indicate a logic error.
Example
Section titled “Example”<?php$config = [ 'host' => 'localhost', 'port' => 3306, 'host' => '127.0.0.1', // Duplicate key - overwrites 'localhost'];How to fix
Section titled “How to fix”Remove duplicate keys or use different keys:
<?php$config = [ 'host' => '127.0.0.1', 'port' => 3306,];