PHP Enums With Practical Examples - Full PHP 8 Tutorial

Pubblicato il: 01 febbraio 2022
sul canale di: Program With Gio
26,488
1k

Let's learn more about the enums feature that was introduced in PHP 8.1 with some practical examples.

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:   / programwithgio  
THANK YOU!

🛠️ TOOLS & SERVICES I USE
Digital Ocean Hosting - Get 100$ credit - https://m.do.co/c/38b935ad74e5
Domains on Namecheap - https://namecheap.pxf.io/rnRjdQ
Envato Elements - https://1.envato.market/c/2937311/298...
Adobe Photoshop & Premiere - https://clk.tradedoubler.com/click?p=...

COURSE PLAYLIST
   • Learn PHP The Right Way - Full PHP Tu...  

RESOURCES
Source repo - https://github.com/ggelashvili/learnp...
Docs - https://www.php.net/manual/en/languag...
Attributes lesson 3.10 -    • PHP Attributes - Simple Router With A...  
PHP 8.1 overview lesson 3.8 -    • What's New In PHP 8.1 - Deprecations ...  

** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.

TABLE OF CONTENTS
00:00 - Intro
00:26 - Constant approach & the problem with constants
04:57 - Enums approach & the solution
09:36 - Pure & backed enums
12:48 - Get enum object from the raw value
15:04 - Methods in enums
19:28 - Static methods in enums
20:24 - Refactoring hardcoded values with enums in attributes
23:33 - Interfaces & traits in enums
24:57 - Enum rules
25:51 - Access list of all cases
26:59 - New function & reflection classes


In questa pagina del sito puoi guardare il video online PHP Enums With Practical Examples - Full PHP 8 Tutorial della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Program With Gio 01 febbraio 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 26,488 volte e gli è piaciuto 1 mille spettatori. Buona visione!