Summary
Keywords
Full Transcript
In the first section of the course, we covered error handling, in this lesson you will learn how to handle exceptions which are the OOP way of handling errors. You'll learn how to throw & catch exceptions, how to create custom exceptions. How to use exception handler, different types of exceptions & PHP's built-in errors, and so on. SOME OF THE WAYS YOU CAN SUPPORT THE CHANNEL 👍 Smash the like button 🤝 Subscribe to the channel & turn the notifications on 💬 Post comments, any feedback is greatly appreciated ⭐ Become a Patreon: https://www.patreon.com/programwithgio THANK YOU! LESSON 2.20 Course Outline - https://github.com/ggelashvili/learnphptherightway-outline Course Playlist - https://www.youtube.com/playlist?list=PLr3d3QYzkw2xabQRUpcZ_IBk9W50M9pe- RESOURCES Lesson 1.7 Float Data Type - https://youtu.be/d3c_OOD4Jzs Lesson 1.28 Basic Error Handling - https://www.youtube.com/watch?v=rQntgj7yink SPL Exceptions - https://www.php.net/manual/en/spl.exceptions.php Global Exception Handler - https://www.php.net/manual/en/function.set-exception-handler.php Error Hierarchy - https://www.php.net/manual/en/language.errors.php7.php CHAPTERS 00:00 - What are exceptions 01:15 - Throwing exceptions 04:34 - Custom exceptions 07:15 - Catching exceptions (try/catch) 11:21 - Finally block & how return statements work from try, catch & finally blocks 14:12 - Global exception handler, error hierarchy & changes in error reporting in PHP 7 & PHP 8 17:50 - When to use exceptions 18:49 - Domain-specific exception class with static methods to throw specific exceptions
