changed get_object_vars() behaviour in PHP 7.4
Investigate and fix any issues resulting from changed behaviour of get_object_vars() in PHP 7.4.
https://www.php.net/manual/en/migration74.incompatible.php states that: Standard PHP Library (SPL): Calling get_object_vars() on an ArrayObject instance will now always return the properties of the ArrayObject itself (or a subclass). Previously it returned the values of the wrapped array/object
CiviCRM uses this function in the following places:
$ grep -R get_object_vars ./*
./CRM/Contact/Import/Parser/Contact.php: $contact = get_object_vars($contactObj);
./CRM/Core/Permission/Joomla.php: foreach (array_keys(get_object_vars($associations)) as $permName) {
./CRM/Financial/BAO/ExportFormat/CSV.php: $queryResults[] = get_object_vars($dao);
./CRM/Admin/Page/Job.php: $rows[] = get_object_vars($job);
./CRM/Utils/XML.php: $obj = get_object_vars($obj);
./CRM/Event/Cart/BAO/Conference.php: $smarty_sessions[] = get_object_vars($dao);
./Civi/Api4/Service/Spec/FieldSpec.php: foreach (get_object_vars($this) as $key => $val) {
./Civi/Api4/Service/Schema/Joinable/Joinable.php: return get_object_vars($this);
Check if the changed behaviour is relevant and refactor code as necessary. May be possible to just close after deeper review.
The same page mentions that this change will affect uses of reset() and current(), and recommends replacement by Iterator methods. There are quite a few uses of both reset() and current() in our codebase.