Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 354 Bytes

DuplicateKey.md

File metadata and controls

21 lines (14 loc) · 354 Bytes

DuplicateKey

When duplicate keys are in an array, it will be overwritten with the specified value later.

Before

<?php
$array = ["a" => 1, "a" => 2]; // DuplicateKey: Duplicate key found in array.

After

<?php
$array = ["a" => 1, "b" => 2]; // OK!

Reference

https://secure.php.net/manual/en/language.types.array.php