"php 5.4: disable warning “creating default object from empty value”" Code Answer


Technically you could do this by installing your own error handler for warnings. From inside the handler check the string error message; if it's the one you want to suppress then return true, otherwise return false to let the default error handler do its thing.

However I would still recommend doing the right thing and manually fixing your code wherever this misuse does appear because, if nothing else, it gets you into the correct habit. Unless this is paid work (in which case there usually are concerns that override purity of implementation), consider this as a lesson and do the right thing.

By Umesh Verma on August 27 2022

Answers related to “php 5.4: disable warning “creating default object from empty value””

Only authorized users can answer the search term. Please sign in first, or register a free account.