Summary
Keywords
Full Transcript
In this PHP tutorial, you will learn about the declare & return statements. When the return is used within a function it stops the execution of the function & returns the value of the expression it's given, if no expression is given it will return null. If the return is used in the global scope (out of a function) then the execution of that script will end & will return the value of the expression or null if no expression is given. Declare statement is used to set execution directives, there are three directives: ticks directive, encoding directive & strict_types directive. The reason I did not talk about the goto statement is that it just makes code harder to maintain & read. You can use other control structures to achieve the same result. If you still want to know how to use it, here is the link to the docs: https://www.php.net/manual/en/control-structures.goto.php 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 1.19 Course Outline - https://github.com/ggelashvili/learnphptherightway-outline Course Playlist - https://www.youtube.com/playlist?list=PLr3d3QYzkw2xabQRUpcZ_IBk9W50M9pe- RESOURCES Check https://www.php.net/manual/en/control-structures.match.php for more info about match expression. CHAPTERS 00:00 - Return statement 01:41 - Declare statement (ticks directive) 03:22 - Declare statement (encoding directive) 03:43 - Declare statement (strict_types directive) 05:45 - Goto statement
