Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108277 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 4949 invoked from network); 27 Jan 2020 21:10:04 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Jan 2020 21:10:04 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 67481180550 for ; Mon, 27 Jan 2020 11:20:16 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 27 Jan 2020 11:20:15 -0800 (PST) Received: by mail-yb1-f180.google.com with SMTP id f136so5458634ybg.11 for ; Mon, 27 Jan 2020 11:20:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=sge4yO1o/EXfKgxxBl6g61zkPU04NC/VJ4zvaAO+mJc=; b=fDBZA/OlAJUEJ8fueAZQJB7TCwBNy9a2u4H8KPTgK6c1tBA4UghwtdFDmfaFakRV90 jT9MlnA6LMaYNlmkOBMFWz4TUROIpUcczwuYYPIxqWThDNzvTjARxhgaii6GjOk1LUKB vlsWxi9yvY41qVb1/P9GGacGAfmEZ9+goU6WUJ9+ybLEH5Q9EwwRsSWHCaDMrVhUki7g EOKptWdwXfLs3Jr/+PRJbLFCQOSx/pROeuZzR4fGRRAwXsSFR0ZHm88VNa9xbmqIUXKN QNPmIpjWei1Gj0Rn/pAyyzli0tPSPLGyVU0WdQn7sIrR9Gml2QW4Qv+E6c2JNZ6soQ3J x/bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=sge4yO1o/EXfKgxxBl6g61zkPU04NC/VJ4zvaAO+mJc=; b=Kt+LCcc/gs8WQ99xMtGnGE08LhUhgsrAj9Ae/EDc+9LJo20oyyNEP01OiMpuC9ogfg yCr5kGe96cCn8GcsCe50yuqkxWxtI3c8PD88Et64opU5iOyyj95vRVZJnf2JHgJEReWL Hmtbs9EH5XNfUIFoDx/RonE2LxWZW532p5QHtoaSt0SkkPE7xAiEg2sIa/Yr0R9UumtU NXtx4jXn2KNR1xHeDo5ZsVbtHg8a+eby1bFxoP+cUKjQmXwuwVR4YhYLxTkuGsJ/GwzE zC1ZhB2kd9nncq7iPOlqBdTpmsmLNWCn/hezE5DhPX7GQyPgPNde3f3mC3gmXGiF9oJ6 deyw== X-Gm-Message-State: APjAAAUr2DDkEEDxuB1lz6vJGcqqP+aOumwE8l5VB0PBxxedvgpHgq8H LIN1BrbdMpEMo978suReo2UmKG5z5dslUw== X-Google-Smtp-Source: APXvYqzMVXeFbCS4URzQ+wA3oDpmNgKaJqPvnrqnXKh97OH6n8z8CNF1TXox8GJm89lreQarXqywLA== X-Received: by 2002:a25:d7d2:: with SMTP id o201mr13638953ybg.245.1580152815241; Mon, 27 Jan 2020 11:20:15 -0800 (PST) Received: from ?IPv6:2601:c0:c680:5cc0:35f6:a15:1002:9a91? ([2601:c0:c680:5cc0:35f6:a15:1002:9a91]) by smtp.gmail.com with ESMTPSA id k133sm6872415ywc.9.2020.01.27.11.20.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jan 2020 11:20:14 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) In-Reply-To: Date: Mon, 27 Jan 2020 14:20:13 -0500 Cc: php internals Content-Transfer-Encoding: quoted-printable Message-ID: References: To: Larry Garfield , Nikita Popov X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] [RFC] Adding a "Stringable" interface to PHP 8 From: mike@newclarity.net (Mike Schinkel) > On Jan 27, 2020, at 10:55 AM, Larry Garfield = wrote: >=20 > On Mon, Jan 27, 2020, at 10:19 AM, Nikita Popov wrote: >> Automatically implementing interfaces based on implemented methods = could >> also be a general language feature (see Go interfaces for example), = but >> likely not one we're interested in having in it's full generality. In = this >> particular case, it seems useful though. >>=20 >> Regards, >> Nikita >=20 > I believe Anthony Ferrara proposed "Weak interfaces" once many years = ago, which is essentially what you're describing. It didn't get much = traction although I'm unclear why. (Possibly just less familiarity with = Go at the time?) >=20 > I agree not all interfaces should be implicit, but having = implicitly-implementable interfaces does sound generally useful. That = shouldn't block this RFC, but might this RFC be a model for how to = implement such things more generically in the future? >=20 > --Larry Garfield Glad to see you picked up on this Larry. I don't think "Weak Interfaces" became an RFC unless Google is failing = me, but I found a reference to it being on the mailing list from = Matthieu Napoli's article on GitHub about decoupling, which is worth a = read: = https://github.com/mnapoli/mnapoli.github.io/blob/master/articles/decoupli= ng-packages.md As far as Go's implicit interfaces, I have found that to be one of the = most compelling language features of Go, and would be ecstatic if we = could find a way to support implicit interfaces in PHP. -Mike