<?php
$someClass = new SomeClass;
class SomeClass {
public $value;
};
var_dump(array_key_exists('value', $someClass));
var_dump(property_exists($someClass, 'value'));
Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, SomeClass given in /in/69mpd:9
Stack trace:
#0 {main}
thrown in /in/69mpd on line 9
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /in/69mpd on line 9
bool(true)
bool(true)