On Wed, 27 Mar 2013, Jordi Boggiano wrote:
> On 27.03.2013 13:18, Lars Strojny wrote:
>
> > Not really, as an interface guarantees behavior, which is not
> > possible for DateTimeImmutable and DateTime.
>
> The interface could be a subset of DateTime public methods, including
> only the readonly ones.
>
> I can't imagine how this could possibly be named in a sane way though :/
Name aside, an interface is sort of very useful otherwise we're ending
up with code like this all over the time:
first_arg_ce = zend_get_class_entry(start);
if ((first_arg_ce != date_ce_date) && (first_arg_ce !=
date_ce_immutable)) {
And that's a real pain, so an interface for just the gettings (and other
methods not modifying/changing anything is probably a good idea. I'll
see if I can work on this over the Easter weekend.
cheers,
Derick
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php