The magic behind Laravel's new defer() helper
Here's how Laravel's defer() function, which was introduced a few months ago, works behind the scenes.
Read more [www.amitmerchant.com]
Posts tagged with magic
Here's how Laravel's defer() function, which was introduced a few months ago, works behind the scenes.
Read more [www.amitmerchant.com]
– Edit
Surprised no one knew about that, but did you know you can do this? pic.twitter.com/OfJ7udnHFe
— Mohamed Said? (@themsaid) 15 augustus 2018
Join 9,500+ smart developers
Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
"Always fresh, useful tips and articles. Carefully selected community content. My favorite newsletter, which I look forward to every time."
by Freek Van der Herten – 2 minute read – Edit
Recently when I was working on a project I got some strange results when using the empty function. Here's what I was debugging. I've simplified the code a bit to share with you. var_dump( $person->firstName, empty($person->firstName) ); This was the result: string(5) "Freek"…
by Freek Van der Herten – 4 minute read – Edit
Last friday Taylor Otwell tweeted an easy to use memoization function called once: Wanted a slick way to generalize class method memoization. Y'all don't even want to know how it works. ? ? pic.twitter.com/xRJAY1C14y— Taylor Otwell (@taylorotwell) November 4, 2016 Taylor was kind…
– Edit
If you're interested in some dark magic you should watch this talk by Marco Pivetta on Voodoo PHP. I really like these show-me-the-code type of talks.
We've often seen "magic" code, but how does it even work? Let's explore some arguably bad PHP coding techniques that are actually used in real world libraries to solve problems that would otherwise be a huge burden for all of us.