Jump to content

Problem with Fatal error: Cannot re-assign $this (php4 -> php5 issue)


progwihz@yahoo.com

Recommended Posts

Hi all, am running a code created with php4 on a php5 engine and I am running into problems with the $this . In php4 its a variable and in php5 its a ref to a class object (if am right)

 

I get the following error in a class "Fatal error: Cannot re-assign $this in {path}" which is caused by this line "$this = new $db( $serv, $user, $pass, $dbName );"

 

How can i resolve this ?  am thinking of renaming $this to something like $this_var but then this is likely not to work.

 

Cheers

 

olu.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.