On 2 December 2016 at 14:46, Andrey Andreev <n...@devilix.net> wrote:
> A magic method is essentially an implicit interface ... > The interface itself does nothing. But when it is implemented, the engine > will know that the class constructor is public and accepts a single > parameter - thus, also knowing that it could try to do a new > ClassName($yourParameterHere) > The interface would not work though, because there should be some logic in place too. For example, if you accept, but convert an array, or an array of arrays etc differently. Or would this be logic that should be placed inside of the constructor, and the castable will just offload to a new construction?