Using php4 object references in php5

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
NateETB1
Forum Newbie
Posts: 6
Joined: Thu Jul 27, 2006 11:00 am

Using php4 object references in php5

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Unfortunately for you, there is no setting to switch object models.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
Post Reply