{"id":86941,"library":"thecodingmachine-safe","title":"Safe PHP","description":"PHP core functions that throw exceptions instead of returning FALSE on error.","status":"active","version":"3.4.0","language":"php","source_language":null,"source_url":"https://github.com/thecodingmachine/safe","tags":["error-handling","exceptions","safety","php"],"install":[{"cmd":"composer require thecodingmachine/safe","lang":"bash","label":"composer require"}],"dependencies":[],"imports":[{"symbol":"file_get_contents","correct":"use Safe\\file_get_contents;"}],"quickstart":{"code":"use function Safe\\file_get_contents;\n\n$content = file_get_contents('/path/to/file'); // throws on failure","lang":"php","description":"Use safe versions of PHP functions that throw exceptions."},"warnings":[{"fix":"Use version 2.x for PHP 7.4 compatibility.","message":"Requires PHP 8.0+ for version 3.x","severity":"breaking","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'core':4 'error':14,16 'error-handl':15 'except':8,18 'fals':12 'function':5 'handl':17 'instead':9 'php':2,3,20 'return':11 'safe':1 'safeti':19 'throw':7","created_at":"2026-06-19T08:10:40.893574+00:00","updated_at":"2026-06-19T08:10:40.893574+00:00","problems":[],"ecosystem":"packagist","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/thecodingmachine/safe","github":"https://github.com/thecodingmachine/safe","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-19","next_check":"2026-12-16","install_tag":null}}