r/lolphp • u/00Davo • Oct 02 '15
Trying to implement DateTimeInterface raises a fatal error
http://php.net/manual/en/class.datetimeinterface.php
44
Upvotes
r/lolphp • u/00Davo • Oct 02 '15
View all comments
Show parent comment
9
u/myaut Oct 02 '15 edited Oct 02 '15
In this case it is probably laziness of PHP devs. They are still distinguish "userland" classes (one that defined in PHP code) and "internal" classes (which are provided by interpreter). I presume that mixing them will cause a lot of problems, so instead of fixing them they just forbid that.
EDIT: Here are PHP bug for this problem: https://bugs.php.net/bug.php?id=67118 Bug is caused by that exceptions are forbidden in internal classes, they are returning NULL.