Working with decimals in PHP apps

3

DB Basics Let’s talk about some of the basics first. float vs decimal In general, floating-point values are usually stored as float in the database. In earlier versions of databases they also often had precision/scale (e.g. float(5,2) for values like…

Leverage your IDE

1

Using the example of PhpStorm 2020.1 and a state-of-the-art CakePHP 4 app. Preliminary remarks The following ideally should adhere to any IDE and framework. I just can’t verify and confirm them all, thus the selection at hand. Please be so…

PHP

Test composer dependencies with prefer-lowest

0

This 4 year old post already blogged about it. Surprisingly many libraries still don’t use it in their CI system yet. The –prefer-lowest option has been added around that time. Composer documentation says: "Useful for testing minimal versions of requirements"….

PHP

Return null vs return void

0

The other day I had a discussion about that, and why important open source frameworks like CakePHP use void in @return doc tags when void and null are code-wise totally identical. So here my reasoning why it is a good…

CakePHP Tips

4

All new CakePHP tips collected over the last few weeks. Dispatcher execution order Tested on Cake2.3RC: APP/webroot/index.php CORE/bootstrap.php APP/Config/core.php APP/Config/bootstrap.php dispatchers defined in CORE bootstrap APP/Config/routes.php APP/Config/database.php controller and all the rest It is important to know that the dispatchers…