Short-hand PHP Dotenv instantiation
Now, this is kind of nit-picky, but I never liked the instructions from phpdotenv on how to initialize their code. This is what they say to do:
$dotenv = new Dotenv\Dotenv(__DIR__); $dotenv->load();
Ok - so that’s not that big of a deal. But, since programmers are lazy and we like to make things even quicker, I decided to use one of PHP 5.4’s new features in my code: Class member access on instantiation.
Now, my PHP code looks super simple - just like this: