Re: [Discussion] is_string(), string type and objectsimplementing __toString()

From: Date: Wed, 08 Mar 2017 18:36:49 +0000
Subject: Re: [Discussion] is_string(), string type and objectsimplementing __toString()
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-98436@lists.php.net to get a copy of this message
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. -- Andrea Faulds https://ajf.me/

« previous php.internals (#98436) next »