It's been said over and over again, but I have to say it too: This entire course is simply outstanding in every way. I had a pretty complex idea of a PHP project in my head for many years, and now, after reaching this far through the course, I find that project idea not only doable, but also embarrassingly easy. Thank you for the time and effort put in these videos!
Good video, and very helpful, surely needed to be watched several times or come back for a refresh if needed to serialize in some project. Great that you've created this course really.
Another great lesson and I learned that the serialize and unserialize methods will be deprecated... Didnt know that and I use that methods extensively.
So far great. One more thing to add, if you specify which property to include in serialization using __sleep method so when you unserialize it, the property that was not included in the sleep method would be set to NULL
The amount of work you provided to us is incredible, the quality of the course is amazing. It's crystal clear and perfectly balanced. Thank you for existing
Good tutorial. I would appreciate you could tell more about why and when we need to use serialization. I seldom serialize an object, therefore would like to know the situation we need to serialize.
Thank you. You would use serialization when you need to pass around objects or save an object & revive it later and use it like in queued jobs for example
Great lesson, first time exposure to serialize and unserialize. I certainly would have to come back here especially as I come across more code. Thanks Gio.
Thank you for the upload, Gio! Gonna keep pestering you with questions though :) You say that serialization is the process of converting a value into a string form but towards the end of the video you made the __serialize method to turn the object into an array. So can you really rely on arrays for storing or transmitting data?
No problem, keep asking the questions. Serialize magic method must return an array of key value pair which is what gets serialized. So it's a flexible way to tell PHP how to serialize an object & what data to serialize. The end result is still a serialized string, the array just provides the structure.
Excellent video. I have two questions. 1- Why is serialize not used more commonly. We most often use JSON now to e.g. store data in database and then convert that to associative arrays or DTOs when fetching from database. Do you have a case where we should serialize? 2- The __sleep and __wakeup methods seem redundant to me. I can see myself always using __serialize and __serialize methods. What do you think?
Thank you. 1. serialize can serialize objects. If you are not serializing objects or complex structures then json is much simpler & better way to stringify it. 2. serialize/unserialize magic methods were introduced in 7.4. So yes I would stick to using serialize/unserialize magic methods. You can read more about it in the RFC: wiki.php.net/rfc/custom_object_serialization
i try to serialize an url and pass it as an argument in another url. When i unserialize i got this error "unserialize(): Error at offset 344 of 519 bytes". Can you please explain ? Thanks !
This course is a blessing, it should be added to the official "php the right way page" !
Thank you 💙
I totally agree.
@@jephthahefereyan7431 Me too! Lifesaver for me!
It's been said over and over again, but I have to say it too: This entire course is simply outstanding in every way. I had a pretty complex idea of a PHP project in my head for many years, and now, after reaching this far through the course, I find that project idea not only doable, but also embarrassingly easy. Thank you for the time and effort put in these videos!
I'm so glad to hear that, thank you 🙏
The best PHP course ever, thanks a million
Thank you 💙
Thank you for explaining the difference between Serialize, Sleep, Unserialize, and Wakeup magic methods.
You're welcome
Best php tutorial!
Thank you 🙌
Impressive and good explanation on serialization in PHP.
Thanks you again Gio.
Glad you liked it. Thank you 🙌
Really wonderful course. Thanks. Having a lesson on deep vs shallow cloning will be nice.
Thank you 🙌
Good video, and very helpful, surely needed to be watched several times or come back for a refresh if needed to serialize in some project. Great that you've created this course really.
Glad to hear that, thank you 🙏
Love all your videos. Keep posting. You don't know how strong you are making the newbies and existing devs like me
Thanks, will do 💙💙
Another great lesson and I learned that the serialize and unserialize methods will be deprecated... Didnt know that and I use that methods extensively.
Thank you, glad it was helpful. Yea I used Serializable interface as well, had to replace with serialize/unserialize magic methods
thank you for the time and effort
You're welcome, thank you!
So far great. One more thing to add, if you specify which property to include in serialization using __sleep method so when you unserialize it, the property that was not included in the sleep method would be set to NULL
👍👍
Fantastican kurs, sve je odlicno objasnjeno. Resio si mi puno dilema :D
Happy to hear 💙
The amount of work you provided to us is incredible, the quality of the course is amazing. It's crystal clear and perfectly balanced. Thank you for existing
Thank you 💙
Good tutorial. I would appreciate you could tell more about why and when we need to use serialization. I seldom serialize an object, therefore would like to know the situation we need to serialize.
Thank you. You would use serialization when you need to pass around objects or save an object & revive it later and use it like in queued jobs for example
This was completely new to me. Thank you!
🙌🙌
Great lesson, first time exposure to serialize and unserialize. I certainly would have to come back here especially as I come across more code. Thanks Gio.
Awesome, thank you 🙌
Great work Gio. Really helpful.
Thank you
Great course and great teacher!!
Thank you 🙌
Thanks a lot!!!! Such a great Tutorial!!!
Thank you 🙌💙
Amazing work dude
Thank you 🙌
Awesome! Thank you so much. waiting for more content specially about deep and shallow object copying.
Thank you 🙌
Super!
Thanks 🙌
Good job man, thanks for share.
Thank you 🙌
Thank you SO MUCH!!!
You're welcome!
Looking forward to deep and shallow coping
👍
Very clear, thanks!
Glad it was helpful, thank you 🙌
Thank you for the upload, Gio! Gonna keep pestering you with questions though :) You say that serialization is the process of converting a value into a string form but towards the end of the video you made the __serialize method to turn the object into an array. So can you really rely on arrays for storing or transmitting data?
No problem, keep asking the questions. Serialize magic method must return an array of key value pair which is what gets serialized. So it's a flexible way to tell PHP how to serialize an object & what data to serialize. The end result is still a serialized string, the array just provides the structure.
Thank you.
💙💙
thank you !
You're welcome!
Excellent video. I have two questions.
1- Why is serialize not used more commonly. We most often use JSON now to e.g. store data in database and then convert that to associative arrays or DTOs when fetching from database. Do you have a case where we should serialize?
2- The __sleep and __wakeup methods seem redundant to me. I can see myself always using __serialize and __serialize methods. What do you think?
Thank you.
1. serialize can serialize objects. If you are not serializing objects or complex structures then json is much simpler & better way to stringify it.
2. serialize/unserialize magic methods were introduced in 7.4. So yes I would stick to using serialize/unserialize magic methods. You can read more about it in the RFC: wiki.php.net/rfc/custom_object_serialization
When to use JSON serialization and when to use the serialize/unserialize php functions? When you need to use the magic hooks?
If you need to serialize objects you would use serialize function. You can use magic methods to handle serialization and unserialization
nice, keep up the good work :)
Thank you
thanks
You got it 💙
Very cool
Thanks
i try to serialize an url and pass it as an argument in another url. When i unserialize i got this error "unserialize(): Error at offset 344 of 519 bytes". Can you please explain ? Thanks !
I would need to see the full code
One comment for the UA-cam's magic algorithms.
💙