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

From: Date: Sat, 11 Mar 2017 13:57:32 +0000
Subject: Re: [Discussion] is_string(), string type and objects implementing __toString()
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  Groups: php.internals 
Request: Send a blank email to internals+get-98482@lists.php.net to get a copy of this message
On 3/11/2017 2:53 PM, Andrey Andreev wrote: > I don't disagree with that in general, but strictly rejecting strings > and other non-integer values would alleviate the problem for a > majority of cases; i.e. would solve the 90% problem. > > What I strongly disagree on is that I should be happy with coercion, > and the almost religious resistance against (non-overridable) strict > scalar typing. > From whom? Where are you getting this from? We are all in favor of adding more types to the runtime to solve more use cases. We are all just concluding that a stringable type should not be constrained to string + object::__toString only. All your examples just help to make it more clear that there is no benefit in doing anything other than that. -- Richard "Fleshgrinder" Fussenegger

« previous php.internals (#98482) next »