safe icon indicating copy to clipboard operation
safe copied to clipboard

All PHP functions, rewritten to throw exceptions instead of returning false

Results 109 safe issues
Sort by recently updated
recently updated
newest added

As migrating to php 8.2, I had to change `utf8_encode` (soon deprecated) to `mb_convert_encoding`. Unfortunately this function when given a string as input returns a string, and when given an...

https://github.com/thecodingmachine/safe/commit/56ab9335d67c505d6eeae411584e2066e7a1ac0e#diff-d50e69bd6199d6bb04c726d9b3da9a0bbbd5731ad3ef6500f42e07ff10fb98a9

Using https://github.com/crate-ci/typos Something like #416 on a bigger scale. This is all I can offer. Please make changes yourself. If you wish I could revert `generated/*` files so you can...

In PHP 8.0+ returns OpenSSLAsymmetricKey|false. For PHPDoc is correct: ``` @return resource|OpenSSLAsymmetricKey ```

Great library, thanks :+1: When using safe functions you lose access to $http_response_header. $http_response_header is created in the local scope. I guess there is no fix for this? I could...

enhancement

The native json_decode function returns: - null in case of an error - an stdClass if the $assoc parameter is false - an associative array if it's true Since the...

enhancement

ext-ftp no longer uses resources and now uses `\FTP\Connection`. But all the safe functions are type-hinted with `resource`. Wrong: ```php /** * Sends an ALLO command to the remote FTP...

There is a link to PHPStan plugin for for the package, but Psalm support is unclear from the README. What is the status?

According to the [document](https://www.php.net/manual/en/function.bzopen.php), bzopen may return `false` when failed.