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

From: Date: Sat, 11 Mar 2017 14:04:38 +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 17  Groups: php.internals 
Request: Send a blank email to internals+get-98483@lists.php.net to get a copy of this message
On Sat, Mar 11, 2017 at 3:57 PM, Fleshgrinder <php@fleshgrinder.com> wrote: > 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. > Oh, FFS! I stopped talking about __toString() 10 emails ago, and probably the 3 of us here are all thinking about different things now. I'm out.

« previous php.internals (#98483) next »