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

The PHP has a problem that the json_last_error will not reset when turning on the JSON_THROW_ON_ERROR flag. - see: https://github.com/php/php-src/issues/10166 When I call `\Safe\json_decode(...,JSON_THROW_ON_ERROR)` after `\json_decode("\00 invalid json")`, and then...

In #385, `mktime` was deprecated in this lib, but technically I think `mktime` will still return `false` in an unusual situation: https://github.com/php/php-src/blob/master/ext/date/php_date.c#L1156 Before digging into php-src to see if it...

see https://github.com/phpstan/phpstan-src/blob/5012e9dc55d89dee0f39459ec8caa2ce7c4a7843/resources/functionMap.php#L6407-L6408

Hello, this objectively is not a fault of Safe but I am wondering if this could/should be solved on Safe's side. The problem is, that when `xdebug` extension is enabled....

PHP 8.4 recently merged changes to emit a deprecation notice on function declared with an implicit nullable type. All upstream functions in php-src already have the nullable types (`?string $var...

Fixes all issues that emit deprecation notices on PHP 8.4 for implicit nullable parameter type declarations. See: - [RFC](https://wiki.php.net/rfc/deprecate-implicitly-nullable-types) - [PHP 8.4: Implicitly nullable parameter declarations deprecated](https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated) The changes are...

This PR fixes currently broken generation by: - Upgrading minimum PHPStan version to one where [this fix was release](https://github.com/phpstan/phpstan-src/commit/110ab291cdd70be080c0a023c467052b8b461c74); - Adding conditions for extra functionality that has been added to...

Hey there! First and foremost, I want to express my appreciation for all the hard work that has already been poured into this package. It is definitely helpful to me....

Currently the generation of files is failing due to ?\\DateTimeZone in a nullable parameter on at least one function. This changeset fixes that a bit crudely but effectively.

# Environment **PHP version:** 8.1.28 **PHPStan version:** 1.10.67 **Safe version:** 2.5.0 **PHPStan Safe Rule version:** 1.2.0 # Description of problem When PHPStan is configured with `missingCheckedExceptionInThrows: true`, and the Safe...