Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97258 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86051 invoked from network); 2 Dec 2016 14:53:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Dec 2016 14:53:24 -0000 Authentication-Results: pb1.pair.com header.from=bowersbros@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bowersbros@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.50 as permitted sender) X-PHP-List-Original-Sender: bowersbros@gmail.com X-Host-Fingerprint: 74.125.82.50 mail-wm0-f50.google.com Received: from [74.125.82.50] ([74.125.82.50:35690] helo=mail-wm0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 83/3B-01781-3EA81485 for ; Fri, 02 Dec 2016 09:53:24 -0500 Received: by mail-wm0-f50.google.com with SMTP id a197so19202930wmd.0 for ; Fri, 02 Dec 2016 06:53:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=vKhBioi3nx3+WqPsX17YGei1bzY2K2kdceBWcEoFVYk=; b=zj6ubMJGCYq0Ypky+brBn6uK68KbiesgSy4ZJOtuO2FMpMZTzVND1ByRoNn/l1yBbP 74mUk24NmXqWpmDtto63pzRtJWcoBTOyV8SF118ph2F8HKAGVQeMtP0jrMpc7yHOZ8p5 enMkDZXt95hHnAyUEpbLg0JzWRzMLbCadK+GRKYLxZY3jOsmaZN2AIx4QNTSBfw15FBI RNMR4x2aeAoPpyLjlSdySD5L0wirw2hE/CZi+26/8zQQoY7cbcR1ehWCXAgpN0jreMrD S7qYxSCAFqsc2pxMe89ZxV8B9o5s2T88GkP2Sgz9lkdECP0jvwJVTWtf2B3m3DYePrv0 mBpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vKhBioi3nx3+WqPsX17YGei1bzY2K2kdceBWcEoFVYk=; b=QakZya9SQcuT7aOnkKz45cUd7KnoWWFfx5leC4Bh6Nr9frNxIR09nMWcbPy3FlWPhY htbAv6THsvEUNwOI5LcI7psaTCfu5fgJgHPhYG1xYIPBEflsL/pCHctsntPdCiKiTTP5 CYWsLbYkyevCM6kb06ZV+62AJ1o9mRwEFxM0J8/hJilnZyEx1lHcM07l2cIS62Xz9X0C ilfUxlIxaR+AHbjgek8nYZm50viiF85VEXvVwDhxUF+ZjQV8VIXKrPLIKlXCjycaqENZ B1NaWteivB3U3DNFCMru+4aNZhIv+fmKdkSxd1CsZ0h7V7yNbqok7e34JX4RaZv11yqB 2ynA== X-Gm-Message-State: AKaTC02lRbaBffXEBiIwdqbHIARtFi0WrwDwlwVTxE3frPXTnSuCBxQ58eAcyf823k0V0ZJbGCNpbNzqBQcNEw== X-Received: by 10.28.71.137 with SMTP id m9mr3209780wmi.88.1480690401298; Fri, 02 Dec 2016 06:53:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.232.77 with HTTP; Fri, 2 Dec 2016 06:53:20 -0800 (PST) In-Reply-To: References: Date: Fri, 2 Dec 2016 14:53:20 +0000 Message-ID: To: Andrey Andreev Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a114c1ca2644f310542ae19c9 Subject: Re: [PHP-DEV] Re: [Concept] Magic Casting From: bowersbros@gmail.com (Alex Bowers) --001a114c1ca2644f310542ae19c9 Content-Type: text/plain; charset=UTF-8 On 2 December 2016 at 14:46, Andrey Andreev 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? --001a114c1ca2644f310542ae19c9--