Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108994 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 96053 invoked from network); 12 Mar 2020 12:46:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Mar 2020 12:46:24 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2D52E1804D8 for ; Thu, 12 Mar 2020 04:07:48 -0700 (PDT) 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_PASS, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS12876 195.154.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from smtp.opensides.be (smtp.fusiondirectory.org [195.154.20.141]) by php-smtp4.php.net (Postfix) with ESMTP for ; Thu, 12 Mar 2020 04:07:47 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by smtp.opensides.be (Postfix) with ESMTP id E0AF94A27AA for ; Thu, 12 Mar 2020 12:07:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at opensides.be Received: from smtp.opensides.be ([127.0.0.1]) by localhost (smtp.opensides.be [127.0.0.1]) (amavisd-new, port 10024) with LMTP id oE6x9Qx0iG3t for ; Thu, 12 Mar 2020 12:07:43 +0100 (CET) Received: from mcmic-probook.opensides.be (63.120.199.77.rev.sfr.net [77.199.120.63]) by smtp.opensides.be (Postfix) with ESMTPSA id 270394A27A7 for ; Thu, 12 Mar 2020 12:07:43 +0100 (CET) To: internals@lists.php.net Date: Thu, 12 Mar 2020 12:07:39 +0100 Message-ID: <3791222.8aREhEtSXm@mcmic-probook> Organization: FusionDirectory User-Agent: KMail/5.2.3 (Linux/4.9.0-12-amd64; KDE/5.28.0; x86_64; ; ) In-Reply-To: <41f72798-b464-4ae9-8b57-c3b2b984f39c@www.fastmail.com> References: <41f72798-b464-4ae9-8b57-c3b2b984f39c@www.fastmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Subject: Re: [PHP-DEV] [VOTE] Object-based token_get_all() alternative From: come.chilliet@fusiondirectory.org (=?ISO-8859-1?Q?C=F4me?= Chilliet) Le mercredi 11 mars 2020, 10:59:19 CET Larry Garfield a =E9crit : > I forget who it was but someone on the list a while back offered a heuris= tic of "__toString should be used iff there is one and only one logical str= ing representation of a value, because the value is conceptually just a str= ing with extra metadata on it". >=20 > That sounds like a really solid heuristic to me. In this case, I think y= es, ->text is the only reasonable thing to produce for __toString(). =20 Yes that was my reasoning, a token is essentially a substring, so I was exp= ecting __toString to reflect this and allow me to use it as a string. =2D-=20 C=F4me Chilliet =46usionDirectory - https://www.fusiondirectory.org