Am 15.02.2013 21:49, schrieb Nikita Popov:
> a) The DateTimeImmutable class extends the DateTime class. Why was this
> done this way? Both classes are incompatible (as in the inheritance
> violates LSP). E.g. if you hint against DateTime, then passing in
> DateTimeImmutable will not work (as the behavior is different). The same
> also applies the other way around (DateTime extending DateTimeImmutable).
> Imho a mutable and an immutable variant of a class can't reasonably extend
> from one another, so I'm not sure why this was done.

 I raised the same question to Derick and he said that it had to be done
 this way because of BC issues. The way it is implemented right now makes
 no sense to me at all. Thank you, Nikita, for bringing this to the
 attention of this list.

-- 
Sebastian Bergmann                    Co-Founder and Principal Consultant
http://sebastian-bergmann.de/                           http://thePHP.cc/

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to