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

array_key_exists deprecated in PHP7.4 #24

Open
marcos-guerrero opened this issue Oct 22, 2019 · 0 comments · May be fixed by #25
Open

array_key_exists deprecated in PHP7.4 #24

marcos-guerrero opened this issue Oct 22, 2019 · 0 comments · May be fixed by #25

Comments

@marcos-guerrero
Copy link

marcos-guerrero commented Oct 22, 2019

Hi!
We are testing PHP7.4 and there's a deprecated feature:
https://www.php.net/manual/es/migration74.deprecated.php#migration74.deprecated.core.array-key-exists-objects

So, in our system, the line https://github.com/austinhyde/IniParser/blob/master/src/IniParser.php#L197 is throwing this error:

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in C:\inetpub\wwwroot\intranet\3rdparty\IniParser\vendor\austinhyde\iniparser\src\IniParser.php on line 197

Our idea, to fix it without too much research would be to implement a private method:

private static function array_key_exists($key_or_property, $array_or_class) { return is_object($array_or_class) ? property_exists($array_or_class, $key_or_property) : array_key_exists($key_or_property, $array_or_class); }

and replace all the array_key_exists calls for self::array_key_exists

Thank you very much in advance for your help!

@dillonco dillonco linked a pull request Jul 19, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant