note 127884 added to function.array-unique
| From: | free dot smilesrg at gmail dot com | Date: | Tue, 01 Nov 2022 14:43:10 +0000 |
| Subject: | note 127884 added to function.array-unique | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219838@lists.php.net to get a copy of this message | ||
$a = new StdClass();
$b = new StdClass();
var_dump(array_unique([$a, $b, $b, $a], SORT_REGULAR));
//array(1) {
// [0]=>
// object(stdClass)#1 (0) {
// }
//}
$a->name = 'One';
$b->name = 'Two';
var_dump(array_unique([$a, $b, $b, $a], SORT_REGULAR));
//array(2) {
// [0]=>
// object(stdClass)#1 (1) {
// ["name"]=>
// string(3) "One"
// }
// [1]=>
// object(stdClass)#2 (1) {
// ["name"]=>
// string(3) "Two"
// }
//}
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.159.161 (proxied: 178.212.100.142)
----
Manual Page -- https://php.net/manual/en/function.array-unique.php
Edit -- https://main.php.net/note/edit/127884
Del: integrated -- https://main.php.net/note/delete/127884/integrated
Del: useless -- https://main.php.net/note/delete/127884/useless
Del: bad code -- https://main.php.net/note/delete/127884/bad+code
Del: spam -- https://main.php.net/note/delete/127884/spam
Del: non-english -- https://main.php.net/note/delete/127884/non-english
Del: in docs -- https://main.php.net/note/delete/127884/in+docs
Del: other reasons-- https://main.php.net/note/delete/127884
Reject -- https://main.php.net/note/reject/127884
Search -- https://main.php.net/manage/user-notes.php