Twig: [2.x] array_key_exists() is deprecated on objects in PHP 7.4

Created on 16 Sep 2019  路  9Comments  路  Source: twigphp/Twig

Seems like it has been fixed for 1.x, but not for 2.x

All 9 comments

It has been fixed for both. Do you have any issue in 2.x?

Yes, I'm getting deprecation warning on latest PHP 7.4 beta and Twig 2.11.3:

An exception has been thrown during the rendering of a template ("array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead")

I believe it is coming from here and here

Well, it was fixed actually, but not released, so in v2.11.3 it is still there.

So, it will be part of the next release.

We're eagerly waiting for the next Twig 2.x release. It's the only remaining incompatibility for our test suite to pass on PHP 7.4 in API Platform. :laughing:

Here too!

This is already fixed, please upgrade.

sorry and thank you very much!
problem is rcrowe/twigbridge for laravel has not updated minimum version.

tengo este problema, me podrian ayudar. En desuso: array_key_exists (): el uso de array_key_exists () en objetos est谩 en desuso. Use isset () o property_exists () en su lugar en C: \ xampp \ xamppp \ htdocs \ miotratienda \ src \ Adapter \ EntityMapper.php en la l铆nea 90

este es el codigo de la linea 90.

if (array_key_exists($key, $entity)) {
$entity->{$key} = $value;
} else {
unset($object_datas[$key]);
}
}
if ($should_cache_objects) {
Cache::store($cache_id, $object_datas);
}
}
} else {
$object_datas = Cache::retrieve($cache_id);
if ($object_datas) {
$entity->id = (int)$id;
foreach ($object_datas as $key => $value) {
$entity->{$key} = $value;

Was this page helpful?
0 / 5 - 0 ratings

Related issues

su-narthur picture su-narthur  路  6Comments

scila1996 picture scila1996  路  3Comments

koflerdavid picture koflerdavid  路  3Comments

dvladimirov77 picture dvladimirov77  路  5Comments

Bilge picture Bilge  路  3Comments