PHP 5 Code for $this = NULL

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
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

PHP 5 Code for $this = NULL

Post by neophyte »

I'm just wondering what the PHP 5 Code for $this = NULL inside of a class would be? I've never seen this before. But I saw it today inside of the fileupload class in osCommerce. It would seem that it is trying to destroy an instantiated object by Nulling it? .....??? :roll: :oops:
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

[php_man]language.oop5.basic[/php_man]

afaik you should use only $this if you need a reference to the current object. I don't think dereferencing $this will actually work... (might be mistaken here)
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

I have had that problem with oscommerce, i don't know what the right thing to do is but i have heard that you can just remove that line.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Thanks

Post by neophyte »

That's what we did we just commented it out. I just wasn't sure if it was a good idea to leave it that way in osCommerce. Thanks for the tips guys....
Post Reply