7: Delete Objects In OOP PHP | Object Oriented PHP Tutorial For Beginners | PHP Tutorial | mmtuts

preview_player
Показать описание
Delete Objects In Object Oriented PHP Programming | OOP PHP Tutorial | Learn OOP PHP. In this PHP lesson you will learn to delete objects previously instantiated from our class.

➤ GET ACCESS TO MY LESSON MATERIAL HERE!

First of all, thank you for all the support you have given me!

I am really glad to have such an awesome community on my channel. It motivates me to continue creating and uploading content! So thank you!

I am now using Patreon to share improved and updated lesson material, and for a small fee you can access all the material. I have worked hard, and done my best to help you understand what I teach.

I hope you will find it helpful :)

Рекомендации по теме
Комментарии
Автор

You are a good teacher. All your tutorials are very easy to understand, thank you.

ayinlaoluwafemi
Автор

Dude thank you so much. Your tutorials are actually easy to follow. More so than most I have used in the past.

PhanTimo
Автор

The OOP tutorial series is too good. But I was expecting you will cover MVC more. I hope you'll create another series for this.

meelanuptech
Автор

I noticed that if I comment out the __destruct method, yet still call unset on index, the $object is still unset. So what's the point of using the __destruct method at all?

jeffhall
Автор

Thanks you very much dear @mmtuts, but i'm still wondering why i need to delete/destroy my object after work? Do you have a real example for it?

obada
Автор

you don't really have to use destruct functions a lot, do you? anyhow good stuff

stanislavidalgo
Автор

I'm a little concerned with this one. You say that the destructor is ran after the class is done loading.
Can you define loading?
I'm seeing the destructor in the first minute showing AFTER you ran some methods of the object. Is there some limit to the number of methods that must be ran? Must you run all the methods you intend to run and after running those, and seeing no more it "loads"?
Why in this example is the destructor AFTER the method if it is ran after the class is loaded? Wouldn't that be when it's created?

Thanks.

frulrd
Автор

Great tutorials, really helpful. I hope in one of the next tutorials, after you've covered most of the basic theory, you can make a usable example, like a simple login script.

barfgameplay
Автор

wait so let me see if I got this right:
unset() usually destroys a variable.
In OOP, using unset() on an object, you say, that what unset() actually does is to explicitly call the destructor which leads to the object being deleted. Ok, so what happens if I don't use a destructor in my class and still use unset() on the object?
I think that unset() will delete the object, which is to say anything we tell the object to do from the point we used unset on the object onward, will return errors, BUT the destructor will still run it's code, as usual in response to the object being deleted.
Correct me if I'm wrong.

grosucosminionut
Автор

it's not really relevant, but what's the name of the theme ur using, because I like the color scheme. I think it's the default theme of sublime text, but I'm using brackets, and maybe someone made an extension for brackets with this theme. Thx in advance. Had a really good theme once which looked very similar to this one for brackets, but don't know which one that was : ( It's not really that important, but it's nice to have a theme which looks nice to the eye when u are coding.

gortex
Автор

I think you are the brother of Elon mask :)

GrowwithZoynul
Автор

While the tutorials are good and helpful, for people like me who follow your PHP OOP playlist, the problem is you don't continue where you left off. For example, in the last video we stopped at the Person class then all of a sudden there's new code in the index.php and also new code in the newClass.php file which we didn't write in the previous episodes. I had to pause the video, understand what the new code you wrote is, and copy it.

adrianjason
Автор

Pause video at :38. Line 13. In that method, why can't we just write it like return $this->data = $newdata, and then echo out that function on the index page like echo $object->setNewProperty("I am a Then we wouldn't need the getProperty method...

jeffhall
Автор

I’m missing something here - if the destructor does it anyway what’s the point of running unset? Won’t it just do it twice? Putting that to one side, what’s the point of it, I see it on a par with running unset on all your variables at the end of your code?

slapmyfunkybass