From 651fad6c6677036edd2871bb78199e17586a3acd Mon Sep 17 00:00:00 2001 From: Mikhail Alferov Date: Tue, 7 Jan 2025 22:57:23 +0300 Subject: [PATCH] array-unique.xml Remove trailing whitespace, CS examples by the way --- reference/array/functions/array-unique.xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/reference/array/functions/array-unique.xml b/reference/array/functions/array-unique.xml index 368b04b6f208..88a79d128721 100644 --- a/reference/array/functions/array-unique.xml +++ b/reference/array/functions/array-unique.xml @@ -25,7 +25,7 @@ Two elements are considered equal if and only if - (string) $elem1 === (string) $elem2, i.e. + (string) $elem1 === (string) $elem2, i.e. when the string representation is the same, the first element will be used. @@ -119,9 +119,11 @@ "green", "red", "b" => "green", "blue", "red"); + +$input = ["a" => "green", "red", "b" => "green", "blue", "red"]; $result = array_unique($input); print_r($result); + ?> ]]> @@ -144,9 +146,11 @@ Array ]]>