Hi!

> Except these two are in separate libraries that cannot share an interface.

If these are separate libraries, you can't be sure that method does the
same thing, or even that it will be existing in both.

> An interface is not possible: separate libraries. Duck-typing is not
> appropriate: only these two specific classes are supported.

This looks very strange and brittle design - two random classes from two
unrelated libraries, which you rely on have exactly the same
functionality and keep it that way. Not a robust design if you ask me.
Also, it looks strange why only those two random classes can be
converted to arrays but none others can. What if you had third class
that also can be converted to array? What if you had 20 of them? Again,
looks like brittle and ad-hoc design.

-- 
Stas Malyshev
smalys...@gmail.com

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

Reply via email to