From 47bc13cc1193cf76a39b5b30d7c6434b5b40ba99 Mon Sep 17 00:00:00 2001 From: Fellan-91 Date: Wed, 15 May 2024 17:22:00 +0300 Subject: [PATCH] added sort comment about php 8 changes --- classes/class-get-portfolio.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classes/class-get-portfolio.php b/classes/class-get-portfolio.php index 8e1545df..d0f808da 100644 --- a/classes/class-get-portfolio.php +++ b/classes/class-get-portfolio.php @@ -1184,6 +1184,11 @@ private static function get_rand_seed_session() { /** * Sort associative array by custom field. + * In some cases, + * The function may sort elements with the same values ​​differently in php 7 and php 8. + * This is due to the following change in how the usort function works. + * If two members compare as equal, they retain their original order. + * Prior to PHP 8.0.0, their relative order in the sorted array was undefined. * * @param array $array - Sortable array. * @param string $field - Array field by which sorting will take place.