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

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

enhancement
missing function

- 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,...

enhancement

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...

bug

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...

bug

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)

bug

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...

bug