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
If you want to use property_exists, you'll need to get the name of the class with get_class()
property_exists
get_class()
In this case it would be :
if( property_exists( get_class($response), 'records' ) ){ $role_arr = getRole($response->records); } else { ... }