note 129241 added to function.uasort
| From: | tecdoc at ukr dot net | Date: | Tue, 13 Feb 2024 14:16:59 +0000 |
| Subject: | note 129241 added to function.uasort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221195@lists.php.net to get a copy of this message | ||
Just wanted to add another way to call uasort by 'Class Name' to the recommendation by
magikMaker 13 years ago
-----------------------
A quick reminder on the syntax if you want to use uasort in a Class or Object:
<?php
// procedural:
uasort($collection, 'my_sort_function');
// Object Oriented
uasort($collection, [$this, 'mySortMethod']);
// Object Oriented with static method
uasort($collection, ['self', 'myStaticSortMethod']);
// Object Oriented with Class Name and static method
uasort($collection, ['\Namespace\Path\To\Class', 'myStaticSortMethod']);
?>
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.131 (proxied: 212.90.59.36)
----
Manual Page -- https://php.net/manual/en/function.uasort.php
Edit -- https://main.php.net/note/edit/129241
Del: integrated -- https://main.php.net/note/delete/129241/integrated
Del: useless -- https://main.php.net/note/delete/129241/useless
Del: bad code -- https://main.php.net/note/delete/129241/bad+code
Del: spam -- https://main.php.net/note/delete/129241/spam
Del: non-english -- https://main.php.net/note/delete/129241/non-english
Del: in docs -- https://main.php.net/note/delete/129241/in+docs
Del: other reasons-- https://main.php.net/note/delete/129241
Reject -- https://main.php.net/note/reject/129241
Search -- https://main.php.net/manage/user-notes.php