Registry / utility / thecodingmachine-safe

thecodingmachine-safe

JSON →
library3.4.0phppackagistunverified

PHP core functions that throw exceptions instead of returning FALSE on error.

composer require thecodingmachine/safe
INSTALL
IMPORT
SIG · THECODINGMACHINE-S
T
thecodingmachine-safe
utilityphpv3.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

file_get_contents
use Safe\file_get_contents;

Use safe versions of PHP functions that throw exceptions.

use function Safe\file_get_contents; $content = file_get_contents('/path/to/file'); // throws on failure
Debug
Known issues
breakingRequires PHP 8.0+ for version 3.x
fix
Use version 2.x for PHP 7.4 compatibility.
affects: >=3.0.0
Upgrade
Version history
3.4.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
thecodingmachine-safe — pip install thecodingmachine-safe · libregistry