Immediately Invoked Function Expression in PHP

Sometimes all you need is to define and call function at the same time and only once throughout the scope. Such functions are called as Immediately Invoke Function Expression (IIFE) also known as Self-Executing Anonymous Function.

» Read More

Best VS Code Dark Themes - 2020 Edition

Another year. Another run down of all the (Dark) themes for VS Code that I’m using in 2020. This time around, I’ve experimented with themes which are quite unusual but have vibrant aesthetics. I’m listing down all the themes down below for you to check out. Sit back and enjoy!

» Read More

Benefits of using custom exceptions in PHP

Exceptions are really useful when you want to handle some situations which can not be handled gracefully otherwise. So, using exceptions, you can handle certain sceanrios by showing a nice error message. Take the following example for instance.

» Read More

Using arrow functions in PHP 7.4

When PHP 7.4 released, it came with a whole lot of features/improvements that makes the language more interesting to work with. The one such feature that I want to talk about is arrow functions. For a primer, arrow functions are not new. In fact, If you’ve been working with the latest JavaScript (EcmaScript 6), you might’ve worked with arrow functions already.

» Read More

Constructor property promotion could be coming to PHP

Have you ever felt the class properties that you’re using in the constructor are essentially repeated multiple times? i.e At the declaration, in the constructor parameters and while doing assignment in the constructor. For instance, take the following example.

» Read More