Page 1 of 1

Using php4 object references in php5

Posted: Wed Nov 14, 2007 10:38 am
by NateETB1
I have a site that was built in php4. I've recently moved to a server running php5, and haven't noticed many problems until today. Then I ran into an issue where I was making a copy of an object like this:

Code: Select all

$copy = $object
This works in php4, but in php5 it has to be

Code: Select all

$copy = clone $object

That change fixed the issue with no problem, but now I am worried that there are other things that aren't working that I just haven't found yet. This site is finished. I don't plan to add new features to it, so I'd like to just be confident that it's all working without upgrading everything to PHP5's OOP model.

So the question I is:

Is it possible to tell php5 to use the php4 OOP model instead? Maybe something like:

Code: Select all

ini_set("object_model", 4)
That would make my life a lot easier right now. I appreciate any help anyone can offer.

Posted: Wed Nov 14, 2007 11:16 am
by feyd
Unfortunately for you, there is no setting to switch object models.

Posted: Wed Nov 14, 2007 11:42 am
by RobertGonzalez
But as a brief recommendation, I'd suggest viewing your error logs to see if there are any incompatibilities that you have not yet seen.