Category: Vanilla PHP

Community Vanilla PHP

Shorthand comparisons in PHP

You probably already know some comparison operators in PHP. Things like the ternary ?:, the null coalescing ?? and the spaceship <=> operators. But do you really know how they work? Understanding these operators makes you use them more, resulting in a cle

96 clicks

Community Vanilla PHP

Building Maintainable PHP Applications: Over-engineering vs under-engineering

Overengineering (or over-engineering) is the act of designing a product or providing a solution to a problem in an elaborate or complicated manner, where a simpler solution can be demonstrated to exist with the same efficiency and effectiveness as that of

97 clicks

Community Vanilla PHP

PHP Attributes: how to use PHP Attributes and create custom attribute classes – Fast Tips

PHP attributes were introduced in PHP 8.0. This version marked a significant milestone for the language, bringing several new features and improvements, including the introduction of attributes for adding metadata to code declarations.

110 clicks

Community Vanilla PHP

Building a procedurally generated game with PHP

Today, we're building a procedurally generated, 2D game with PHP. It's a simple game that's focussed around resource gathering on a procedurally generated map.

166 clicks

Community Vanilla PHP

PHP 8.3 Released

PHP 8.3 is a major update of the PHP language. It contains many new features, such as explicit typing of class constants, deep-cloning of readonly properties and additions to the randomness functionality. As always it also includes performance improvement

142 clicks

Community Laravel Vanilla PHP

Refactoring conditionals to callables in PHP

Recently, I came across a very handy tip by Nuno Maduro where you can refactor some of the conditionals in your code to callables to make your code more elegant and readable.

267 clicks