I am getting this warning in PHP 7.2 that wasn't showing up in 5.6.
Warning: Use of undefined constant object - assumed 'object'
Here's what my code looks like...
CLASS WPA_PAGE {
VAR $obj_template = object;
function build_content() {
global $app;
$this->obj_template = new wpa_custom_template(); <---Warning occurs Here.
}
}
** Note that I have stripped out a lot of code for purposes of this post.
As you can see, I have declared $this->obj_template in the beginning of the class. I have a lot of similar code to this that doesn't seem to be generating any sort of error.
Is there something wrong with my syntax here or do you think something that is unsetting the variable/object before I am instantiating it?
can anyone help?
VAR $obj_template = object;? This looks a lot like PHP 4. Time to update your code.