PHP - warning - Undefined property: stdClass - fix?

后端 未结 9 1089
梦毁少年i
梦毁少年i 2020-11-30 05:22

I get this warning in my error logs and wanted to know how to correct this issues in my code.

Warning: PHP Notice: Undefined property: stdClass::$records in script

9条回答
  •  旧时难觅i
    2020-11-30 05:50

    Depending on whether you're looking for a member or method, you can use either of these two functions to see if a member/method exists in a particular object:

    http://php.net/manual/en/function.method-exists.php

    http://php.net/manual/en/function.property-exists.php

    More generally if you want all of them:

    http://php.net/manual/en/function.get-object-vars.php

提交回复
热议问题