I like this library and promote that wherever I can, but the safe library was even mentioned in the post:
> I love the smell of false in the morning, but despite that I do wish that all PHP’s built-in functions threw exceptions. We have the famous safe library which does just that! But if you’re like me then you don’t like coupling huge amounts of code in perpetuity to an external library.
I just wrap the ones I actually need that for and put them in traits (sometimes multiple related per trait). So it's internal, small footprint, and really needs 0 maintenance. This is also good for e.g. json_* when you want to provide app-wide defaults.
Ah, I'd completely missed that. As for depending on an external library ... get used to it. Writing PHP without any external deps is strictly for one-off scripts -- and rarely even then.
> I love the smell of false in the morning, but despite that I do wish that all PHP’s built-in functions threw exceptions. We have the famous safe library which does just that! But if you’re like me then you don’t like coupling huge amounts of code in perpetuity to an external library.