Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98438 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48929 invoked from network); 8 Mar 2017 18:44:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Mar 2017 18:44:28 -0000 X-Host-Fingerprint: 95.148.67.80 unknown Received: from [95.148.67.80] ([95.148.67.80:10589] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/4A-06022-A0150C85 for ; Wed, 08 Mar 2017 13:44:28 -0500 Message-ID: <9E.4A.06022.A0150C85@pb1.pair.com> To: internals@lists.php.net References: <8B230568-9074-4928-B9C9-F1F138054CD7@gmail.com> <89.A9.06022.54F40C85@pb1.pair.com> Date: Wed, 8 Mar 2017 18:44:23 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Posted-By: 95.148.67.80 Subject: Re: [PHP-DEV] [Discussion] is_string(), string type andobjectsimplementing __toString() From: ajf@ajf.me (Andrea Faulds) Fleshgrinder wrote: > On 3/8/2017 7:36 PM, Andrea Faulds wrote: >> Hi, >> >> Andrey Andreev wrote: >>> The question is rather "is this value a string?", only with the added >>> assumption that __toString() objects are treated as "string objects" >>> and thus fulfill the condition (another reason why I went for an >>> is_string() parameter). >> >> This is a faulty assumption. The presence of __toString() doesn't mean >> the object is a string, or intended to be used like one. >> > > What is it then in your book? > It means the object can be converted to a string. But such a conversion may entail a loss of information and not be equivalent to the object itself. It might be a “human-readable” form, for instance. -- Andrea Faulds https://ajf.me/