phpmyadmin CoreExtension.php#1608array_key_exists(): Using array_key_exists() on objects is deprecated

Viewed 1356

I have problem with twig. i installed phpmyadmin through apt and it depends on php-twig that seems old. currently the newest version of twig is 3.2.1 and for one in apt repo is 2.10.0-2 (i don't know if they are not compatible versions).

Anyway i saw this error on phpmyadmin:

phpmyadmin in ./../../php/Twig/Extension/CoreExtension.php#1608array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead.

1 Answers

So the twig would not be updated and i just tried to edit the file pointed in the error and that worked.

first i typed in bash: (i found the file with find command)

sudo mousepad /usr/share/php/Twig/Extension/CoreExtension.php

(in mousepad you can see line numbers by edit>preferences then check show line numbers).

and went to line 1608(with CTRL+l), then replaced the line with the following line:

if (isset($object->$item) || property_exists($object, (string) $item)) {

That's all! phpmyadmin is working now without any error.

Related