Inspired by a recent discussion in the PHP Internals, I decided to provide a userland solution. Check this:
<?php $hash = hash_init('md5'); // vanilla functions: is_resource($hash); // true in PHP <= 7.1, false in PHP >= 7.2 get_resource_type($hash); // "Hash Context" in PHP <= 7.1, various errors otherwise // library functions: \Arokettu\IsResource\is_resource($hash); // true \Arokettu\IsResource\get_resource_type($hash); // "Hash Context"
Get it on my dev portal: https://sandfox.dev/php/is-resource.html
So... Let's compare.
Please even if you do not agree with him politically but still don't like that raging mobs decide for others, sign the letter here: https://github.com/rms-support-letter/rms-support-letter.github.io/pulls
I haven't found a good standalone pseudolocalization library for PHP so I wrote my own.
Or if you're using Symfony Components or you don't mind using huge libraries for simple tasks, there is one good alternative:
PseudoLocalizationTranslatorin the Symfony Translation Component since version 5.2.
If you have a separate user writable drive mounted, you may have encountered the same problem I had. If your DE cannot create
.Trash-$uid, most DEs will not delete files to the trash at all and KDE will copy deleted files to your home partition. I find both behaviors frustrating.
The solution is rather simple: look at the spec and create the trash directory manually.
Now delete some file from that partition and check that is lands to
.Trash/$uid/files. Your trash directory now works properly.