Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108481 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 32394 invoked from network); 11 Feb 2020 15:06:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Feb 2020 15:06:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 77FE71804E6 for ; Tue, 11 Feb 2020 05:20:24 -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 05:20:22 -0800 (PST) Received: from [192.168.178.23] (x4d063995.dyn.telefonica.de [77.6.57.149]) by dd46610.kasserver.com (Postfix) with ESMTPSA id DAECC434079D; Tue, 11 Feb 2020 14:20:20 +0100 (CET) To: =?UTF-8?Q?Micha=c5=82_Brzuchalski?= , Guilliam Xavier Cc: Nicolas Grekas , Nikita Popov , PHP Internals List References: Organization: Aimeos GmbH Message-ID: <50d66703-6f55-7430-6dd3-5a765bcadf59@aimeos.com> Date: Tue, 11 Feb 2020 14:20:20 +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: 8bit Subject: Re: [PHP-DEV] [RFC] Adding a "Stringable" interface to PHP 8 From: norbert@aimeos.com (Aimeos | Norbert Sendetzky) Am 11.02.20 um 14:11 schrieb MichaƂ Brzuchalski: >>> Traversable, Serializable, Countable, Throwable, JsonSerializable >>> all are related to some special engine behavior, which this ones also is. >> >> But one could argue that "string" is not a verb like "traverse", >> "serialize", "count", "throw" etc. >> Potential alternatives would be Stringifyable (or Stringifiable?), >> StringCastable, StringConvertible... >> (Even though I personally have no problem with "Stringable") >> > Maybe StringObject? We do already have ArrayObject. A StringObject would need to offer the same methods that are available for strings (even if ArrayObject doesn't do that completely). Even if "string" isn't a verb, it matches the intended meaning: serialize -> Serializeable -> can be serialized count -> Countable -> can be counted throw -> Throwable -> can be thrown If I take the alternatives into account, I would still opt for "Stringable" because it's: - easy to spell - easy to remember - shorter than the alternatives - matches exactly the intended meaning - consistent with the other PHP class nameings