Posts about PHP (old posts, page 3)
-
PHP 8.2 Released
PHP 8.2 has been released. It's a relatively small release by new features. I already covered some of them. Here are things that I would like to highlight:
-
Unsigned
Unsigned is a fixed (but arbitrary) length unsigned integer arithmetic library for native PHP. It was created as a helper for the Random Extension Polyfill to remove hard dependency on the GMP. It may be useful for weird arithmetic with shifts and unsigned overflows that is used in RNGS, encryptors, hashes, etc. (But it won't be cryptographically secure! Time based attacks are quite possible because of some optimizations) Performance greatly depends on the PHP version, with PHP 8.0+ it performs quite nicely, only slightly slower than GMP.
-
Polyfill for Random Extension
Announcing my new library, a polyfill for the new sexy
ext-random
from PHP 8.2 that I mentioned a couple of posts ago. It requires PHP 7.1+ and the GMP extension.There will be some limitations with the compatibility but it's already usable for most simple use cases. Grab it here: https://sandfox.dev/php/random-polyfill.html
Many thanks to Go Kudo for his work on the original extension.
-
Early Look at PHP 8.2
It's a month before the feature freeze so we can predict what the release will look like. So far it seems like an underwhelming release without any killer features. It still has very nice language improvements.
These are the things I would like to highlight:
-
License Manager for Composer
I found myself in a need to filter away some licenses for my dependencies (AGPL, I'm looking at you). I've found a well known plugin for that: metasyntactical/composer-plugin-license-check.
The problem that I found with it is that it doesn't prevent you from installing blacklisted packages. I mean it was designed to do that but fails on Composer 2.0+.
I started investigating for the ways to fix that but ended up with a feature complete plugin. It also offers some more flexibility in the config.
Grab it here: https://sandfox.dev/php/composer-license-manager.html