Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] array_key_exists() is deprecated on objects in PHP 7.4 #3151

Closed
iotch opened this issue Sep 16, 2019 · 9 comments
Closed

[2.x] array_key_exists() is deprecated on objects in PHP 7.4 #3151

iotch opened this issue Sep 16, 2019 · 9 comments

Comments

@iotch
Copy link

iotch commented Sep 16, 2019

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

@fabpot
Copy link
Contributor

fabpot commented Sep 16, 2019

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

@iotch
Copy link
Author

iotch commented Sep 16, 2019

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.

@Tobion
Copy link
Contributor

Tobion commented Sep 17, 2019

There is no new 2.x release since then 03dbdb9

@fabpot
Copy link
Contributor

fabpot commented Sep 17, 2019

So, it will be part of the next release.

@teohhanhui
Copy link

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. 😆

@n3storm
Copy link

n3storm commented Nov 28, 2019

Here too!

@nicolas-grekas
Copy link
Contributor

This is already fixed, please upgrade.

@n3storm
Copy link

n3storm commented Nov 28, 2019

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

@jonatan12328
Copy link

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;

Davidmattei pushed a commit to Davidmattei/EMSClientHelperBundle that referenced this issue Dec 28, 2020
The core is already using 2.14, but the clientHelper and common are not.
Important because we got this deprecation 1663 times on each page:

Deprecated: array_key_exists(): Using array_key_exists() on objects is
deprecated. Use isset() or property_exists() instead

More info: twigphp/Twig#3151
Davidmattei pushed a commit to Davidmattei/EMSCommonBundle that referenced this issue Dec 28, 2020
The core is already using 2.14, but the clientHelper and common are not.
Important because we got this deprecation 1663 times on each page:

Deprecated: array_key_exists(): Using array_key_exists() on objects is
deprecated. Use isset() or property_exists() instead

More info:
twigphp/Twig#3151
Davidmattei pushed a commit to Davidmattei/EMSClientHelperBundle that referenced this issue Dec 29, 2020
The core is already using 2.14, but the clientHelper and common are not.
Important because we got this deprecation 1663 times on each page:

Deprecated: array_key_exists(): Using array_key_exists() on objects is
deprecated. Use isset() or property_exists() instead

More info: twigphp/Twig#3151
Davidmattei added a commit to ems-project/EMSClientHelperBundle that referenced this issue Dec 30, 2020
The core is already using 2.14, but the clientHelper and common are not.
Important because we got this deprecation 1663 times on each page:

Deprecated: array_key_exists(): Using array_key_exists() on objects is
deprecated. Use isset() or property_exists() instead

More info: twigphp/Twig#3151
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

7 participants