Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PHP Magic & how Laravel uses it - LaraconEU 201...

PHP Magic & how Laravel uses it - LaraconEU 2019 Unconference

Avatar for Miguel Piedrafita

Miguel Piedrafita

August 30, 2019

More Decks by Miguel Piedrafita

Other Decks in Technology

Transcript

  1. PHP ✨ magic & how Laravel uses it Miguel Piedrafita

    (@m1guelpf) · LaraconEU 2019 Unconference
  2. A quick disclaimer 4 I hacked this slides together last

    night 4 I haven't had time to practice this talk, so I have no idea how long it'll take me
  3. A quick disclaimer 4 I hacked this slides together last

    night 4 I haven't had time to practice this talk, so I have no idea how long it'll take me 4 It's also my first talk ever so I'm reeeeally nervous
  4. A quick disclaimer 4 I hacked this slides together last

    night 4 I haven't had time to practice this talk, so I have no idea how long it'll take me 4 It's also my first talk ever so I'm reeeeally nervous 4 Oh, and I haven't slept a lot in the last two days
  5. A quick disclaimer 4 I hacked this slides together last

    night 4 I haven't had time to practice this talk, so I have no idea how long it'll take me 4 It's also my first talk ever so I'm reeeeally nervous 4 Oh, and I haven't slept a lot in the last two days Sooooo, let's get started
  6. PHP ✨ magic & how Laravel uses it Miguel Piedrafita

    (@m1guelpf) · LaraconEU 2019 Unconference
  7. ! PRO TIP If you assign the PendingDispatch to a

    variable it'll never destruct and never dispatch the job Pssssst! Feel free to steal this for a tweet on Twitter
  8. DEBUGGING TIP All this magic functions won't fire if the

    property exists on the class Pssssst! Feel free to steal this for a tweet on Twitter
  9. ¯\_(ϑ)_/¯ Don't ever use extract() unless you have a good

    reason to. And I mean a reeeeeally good reason. It's also probably really insecure. So, like, don't use it. Ever. Well, maybe not ever, but you understand.
  10. I'm probably already way out of time, so this are

    some things you can ask me about later:
  11. I'm probably already way out of time, so this are

    some things you can ask me about later: 4 ArrayAccess, or how to make a class behave as an array
  12. I'm probably already way out of time, so this are

    some things you can ask me about later: 4 ArrayAccess, or how to make a class behave as an array 4 The amazing world of RefectionClass, ReflectionMethod & ReflectionProperty
  13. I'm probably already way out of time, so this are

    some things you can ask me about later: 4 ArrayAccess, or how to make a class behave as an array 4 The amazing world of RefectionClass, ReflectionMethod & ReflectionProperty 4 The __toString magic method
  14. I'm probably already way out of time, so this are

    some things you can ask me about later: 4 ArrayAccess, or how to make a class behave as an array 4 The amazing world of RefectionClass, ReflectionMethod & ReflectionProperty 4 The __toString magic method 4 The __sleep & __wakeup magic methods
  15. I'm probably already way out of time, so this are

    some things you can ask me about later: 4 ArrayAccess, or how to make a class behave as an array 4 The amazing world of RefectionClass, ReflectionMethod & ReflectionProperty 4 The __toString magic method 4 The __sleep & __wakeup magic methods 4 General Laravel magic
  16. I'm probably already way out of time, so this are

    some things you can ask me about later: 4 ArrayAccess, or how to make a class behave as an array 4 The amazing world of RefectionClass, ReflectionMethod & ReflectionProperty 4 The __toString magic method 4 The __sleep & __wakeup magic methods 4 General Laravel magic 4 Anything else !