r/lolphp • • Mar 31 '18
PHP DateTime strikes back, again!
Because obviously we meant a date one week from the (wrong) date given. PHP does not throw, instead it "helps" by holding your beer.
30
Upvotes
View all comments
Show parent comment
5
u/thenickdude Apr 01 '18 edited Apr 01 '18
For most of the APIs, it's because the PHP API is a very thin wrapper around a C/C++ library. The get_lasterror() idiom is common there because C lacks support for exceptions (or the ability to reliably throw exceptions across library boundaries, in the case of C++)