In moving our archive to a new Ubuntu server our service provider encountered this error:
Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /home/pateam/public_html/application/libraries/Zend/Registry.php on line 206
This looks like a simple error BUT
/home/pateam/public_html/application/libraries/Zend/Registry.php is not a valid path. We changed line 206 in /home/pateam/public_html/Omeka/application/libraries/Zend/Registry.php and the website continues to throw the same error.
A search of the directory found 4 instances of Registry.php. We could search out and change all 4 but that may not be the end of it. A google search for the error found this explanation:
array_key_exists() is NOT deprecated, the deprecation is using the function with objects (i.e. something like Joomla\Registry\Registry which implements ArrayAccess meaning you can work with the registry object as an array).
$thing = new Joomla\Registry\Registry;
$thing[‘foo’] = true;
$thing[‘bar’] = true;
array_key_exists(‘foo’, $thing); // emits deprecation because an object is being checked
$otherThing = array();
$otherThing[‘foo’] = true;
$otherThing[‘bar’] = true;
So array_key_exists may be searching for something it can’t find and throwing this misleading error message.
The new machine runs php 7.4. the old ran php 7.2