PHP check whether property exists in object or class

后端 未结 8 1535
情深已故
情深已故 2020-12-02 11:01

I understand PHP does not have a pure object variable, but I want to check whether a property is in the given object or class.

$ob = (object) array(\'a\' =&g         


        
8条回答
  •  甜味超标
    2020-12-02 11:27

    Using array_key_exists() on objects is Deprecated in php 7.4

    Instead either isset() or property_exists() should be used

    reference : php.net

提交回复
热议问题