4 ms·
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 despi
by alfredbez 3y ago
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.
- chuckadams 3y agoAh, 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.
- user3939382 3y agoI 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.