Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108467 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 5347 invoked from network); 11 Feb 2020 13:56:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Feb 2020 13:56:23 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C3F55180532 for ; Tue, 11 Feb 2020 04:10:17 -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,SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS34788 85.13.163.0/24 X-Spam-Virus: No X-Envelope-From: Received: from dd46610.kasserver.com (dd46610.kasserver.com [85.13.163.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 11 Feb 2020 04:10:16 -0800 (PST) Received: from [192.168.178.23] (x4d063995.dyn.telefonica.de [77.6.57.149]) by dd46610.kasserver.com (Postfix) with ESMTPSA id 012274340491; Tue, 11 Feb 2020 13:10:14 +0100 (CET) To: Nikita Popov , Nicolas Grekas Cc: PHP Internals List References: Organization: Aimeos GmbH Message-ID: Date: Tue, 11 Feb 2020 13:10:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Adding a "Stringable" interface to PHP 8 From: norbert@aimeos.com (Aimeos | Norbert Sendetzky) Am 11.02.20 um 12:58 schrieb Nikita Popov: > Just so someone has mentioned it... is "Stringable" really the best name > for this interface? Reddit really didn't like it ;) Some possible > alternatives: ToString, HasToString, CastsToString. I would vote for "Stringable" because PHP already has interfaces like Throwable, Countable, Traversable, Serializable and so on :-) > Something to keep in mind is that there has been a recent proposal for > "Arrayable" as well, and that had very different semantics (not about > __toArray() at all). I came up with the proposal of an Arrayable interface whose intention is in fact very close to Stringable (can be used like an array and converted to array vs. can be converted to string) But time doesn't seem to be ripe for Arrayable because the __toArray() RFC isn't accepted yet and there needs to be more discussion if Arrayable should only contain __toArray() or if it should extend from Countable and Traversable too.