1
votes

I'm moving over a website with a custom CMS (which I didn't build) to a new server which runs 5.6.31 php.

It seems to error with the "$this" creating the "Warning: Creating default object from empty value in error".

Even when I turn off the errors in php.ini it still throws up a error print out.

The site does work locally on 5.6 so I'm guessing it has something disabled in the php.ini.

I know all this code would need to ideally be rewritten as it might not even work at all in php 7.

I was just wondering if I had a quick fix option something that could be tweaked in the server.

This is the code in question...

$this->view->css = 'THEME';
$this->view->js = 'ALL';
$this->view->font = 'ALL';

If anyone can help me on this, I would be very grateful.

1
The code snippet - is it inside a class? - Professor Abronsius
You need to put more code. From the piece you placed, it could be that your have not properly initialized the variables, the warning was always there and you just realized now. - Emilio Pastor Mira

1 Answers

1
votes

It means that $this->view is not a value yet, and it's creating a default empty object from it. More information here