spatie/data-transfer-object library provides very easy to use data-transfer objects for PHP. If you code is relying a lot on arrays, you’ll appreciate this different approach. And the more complex your arrays are, the more benefit you’ll get out of it.
Tag: PHP
brick/math – Arbitrary-precision arithmetic library for PHP
PHP is well-known for its rather basic interpretation of precision numbers and operations on those. BC Match extension helps, but sometimes one needs more. brick/math is a composer-installable library that helps with arbitrary-precision arithmetic.
PHP is dead…Viva le PHP!
Here’s a great post on why all those “PHP is dead” blog posts and forum threads are a complete load of crap.
Here’s the reality: nearly 80% of the internet is running on PHP as of 2018.
I guess PHP isn’t that dead after all.
PHP doesn’t scale. Riiiiiight. Wikipedia runs entirely on PHP and is the fifth most visited site on the internet. There’s also this little site called Facebook that uses PHP, ever heard of it?
My favorite quote from that blog post is this one:
PHP is the Fidel Castro of programming languages; after all Castro outlived five US presidents who ordered his assignation.
That’s a nice way to put it …
Show outdated composer packages
A while back I shared a way to show outdated composer packages. Today, I want to expand on it a little bit. Thanks to this tweet:
https://twitter.com/waltertamboer/status/1059567319725301762
I think it’s slightly easy to remember with “composer show -molD -strict” (“old”, “mold”). Adding this to the test suite is a great tip too!
For other ways to show the outdated packages (using composer plugins), have a look at this StackOverflow thread.
The Land Where PHP Uses eval()
“The Land Where PHP Uses eval()” is an interesting post powered by the study of 2,000 Open Source PHP projects. It details a number of scenarios where developers have used the eval() function and suggests the better ways for most of these. Despite of how dangerous and inefficient the eval() is in PHP, there are still good reasons to use it in some cases. Read the full post to see which are those.