safe
safe copied to clipboard
All PHP functions, rewritten to throw exceptions instead of returning false
This is a feature request to add support for the `idn_to_ascii` function. Ref: https://www.php.net/manual/en/function.idn-to-ascii.php > Return values: The domain name encoded in ASCII-compatible form, or false on failure
- current (https://github.com/thecodingmachine/safe/issues/262) - next - prev - end - reset
As described in https://github.com/thecodingmachine/safe/issues/310#issuecomment-1005515855, currently we can only support one exact php version at the time. This is already causing conflicts between php8.0 and php8.1 function signatures. To solve this,...
In PHP 8.0 and 8.1, plenty of functions had their return values changed from `$type|false` to `$type` (i.e. `array|false` => `array`). Because these function no longer have a 'falsy' return...
(Possibly improves #306) In PHP 8.0 and 8.1, plenty of functions had their return values changed from `$type|false` to `$type` (i.e. `array|false` => `array`). Because these function no longer have...
In `Safe\finfo_open` we throw an exception when `\finfo_open` returns null. But occording to the docs, the function returns `false` on failure instead of `null`. So we should be throwing an...
Actually functions `date_sunrise` and `date_sunset` released in version `v1.3.3` have a bug: ```php function date_sunrise(int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, float $latitude = null, float $longitude = null, float $zenith...
In a lot of GD extension functions, the previously passed `resource` has been replaced by `GdImage` in PHP8. Our docblocks are incorrect. (see: https://github.com/thecodingmachine/safe/blob/master/generated/image.php)
The `Safe\shell_exec` function currently throws an exception when `null` is returned from `\shell_exec`. A `null` return is not always equal to an error occording to the docs. https://www.php.net/manual/en/function.shell-exec.php > This...