Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93303 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49689 invoked from network); 13 May 2016 02:29:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 May 2016 02:29:42 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.178 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.178 mail-pf0-f178.google.com Received: from [209.85.192.178] ([209.85.192.178:33470] helo=mail-pf0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FC/AB-28272-51C35375 for ; Thu, 12 May 2016 22:29:42 -0400 Received: by mail-pf0-f178.google.com with SMTP id 206so37152990pfu.0 for ; Thu, 12 May 2016 19:29:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=/WFrwND8PHMVw52H7H+oueWucUx14AAfKPEUWbqyJik=; b=jJDV0o6z5BNL4wQRhmEWi/LkREVgh2N94x+Kjb5iuaw6BfGmWVNFXrD1p4uwRHzwuj 1WyJp/Mx052uJIhu2YGaIT8AWBfiEBLiESNSI1/CnEgfqbXx/1u1/sDXrTaAPvbdPm7V 2sv+wcqJnRVqu+2yDJ36m7tOjGbd9UCfiHhsBRc84KUHaIRbaHM/yiHRSWtSRi80rc2+ 25h27VTDMk9hj/mD6GEx3Qw5LazbqG7aLNKNY5jD/Kko+HRjZH2v8w/SLRCWvFUoERQv eyZZfw33cUniH0k5JTfkDpj8aAxQZGFt3RoWA6GBHUhOcmT5y2xrkPat7CoHoBw62tkj lGLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=/WFrwND8PHMVw52H7H+oueWucUx14AAfKPEUWbqyJik=; b=XdrTkb2bWHkvW2sbid8YGRWtfQV66ixoAjVFWAy7twgJQUuAuNQWZgWr6VOjrkx9uf 3fxAFLPqPi/44Jfli/O69OlXey/OP0/cV188lzvDw72Tv6LLSvaDHJdWyzYvWaEonoOP Q9KxYyWBvbQcF9kaMIXWf5N06S3xf81OSuhOeMzQuGc/h3ZsWlZQqxWdjdmAGhMl4wsv XRX8EsCJvMiJRYdZ+nmD4qE2xCr3wJ8wpT54/jnRfO1UZ9aQX6saAYMKE2jeO69nGrgq ALiJKGsIBahcuE1sCQRgV/TOf55r0UQPfWE4stSI5JEHTjLW/T0dd+XIqvnDKNBG0J7H DUvw== X-Gm-Message-State: AOPr4FWsOJ5mceJFIB7++EjZm2PNlbXRVFnZyyfTXwJdRtS3f2+fQVxkuRE/KbBV0KpdBg== X-Received: by 10.98.25.15 with SMTP id 15mr19050580pfz.60.1463106578660; Thu, 12 May 2016 19:29:38 -0700 (PDT) Received: from Stas-Air.local (76-220-46-95.lightspeed.sntcca.sbcglobal.net. [76.220.46.95]) by smtp.gmail.com with ESMTPSA id g84sm22837672pfj.42.2016.05.12.19.29.36 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 May 2016 19:29:37 -0700 (PDT) To: Marco Perone , internals@lists.php.net References: <5734B148.40602@mvlabs.it> Message-ID: <7a0cd8ee-525e-1e1b-014a-cd76cb0429ff@gmail.com> Date: Thu, 12 May 2016 19:29:30 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <5734B148.40602@mvlabs.it> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Functorial interfaces From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > The PHP manual says, regarding Interfaces, that the class implementing > the interface must use the exact same method signatures as are defined > in the interface. Not doing so will result in a fatal error. I think this is mainly for practical reasons - when you compile class Bar, you may not know what SpecialClass and BaseClass are. This is not a problem for checking the calls - if by the time you get to the call they are still not known, you can be sure whatever you've got as a parameter is *not* instance of them. However, if you wanted to check if Bar properly implements Foo, you'd need to know relation between SpecialClass and BaseClass. So that makes the deal way more complex, especially given that you'd need to load SpecialClass and BaseClass in the middle of defining Bar, so what if they depend on Bar? -- Stas Malyshev smalyshev@gmail.com