Labels |
Added:
?
|
Title |
|
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;
array_key_exists('foo', $otherThing); // this is OK
There are instances of using the function with objects
It's possible. Could you point to some instances?
Labels |
Added:
Information Required
|
Closing for now - will keep an eye on my error logs
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-12-21 14:03:28 |
Closed_By | ⇒ | brianteeman |
Status | Closed | ⇒ | New |
Closed_Date | 2019-12-21 14:03:28 | ⇒ | |
Closed_By | brianteeman | ⇒ |
If you compare two versions of an article you will get the error
Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in \joomla-cms\administrator\components\com_contenthistory\Model\CompareModel.php on line 104
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-01-12 09:42:53 |
Closed_By | ⇒ | alikon |
I have just changed
return array_key_exists($index, $this);
to
return array_key_exists($index, (array) $this);
It is working. I just type cast in Array datatype
Edited title to not be misleading.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27214.