Re: [PATCH] Consistent type names in error messages

From: Date: Sun, 14 Dec 2014 22:09:51 +0000
Subject: Re: [PATCH] Consistent type names in error messages
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-79650@lists.php.net to get a copy of this message
Hey Rowan, > On 14 Dec 2014, at 21:20, Rowan Collins <rowan.collins@gmail.com> wrote: > > I had a go at this a few months ago, but haven't updated my patch based on what's > changed in the engine since, so it probably wouldn't merge cleanly: > https://github.com/php/php-src/pull/769 Yeah, I was inspired by your efforts. :) > An additional case which it looks like you haven't covered is "Object of class %s > could not be converted to double" in zend_operators.c and zend_object_handlers.c: > https://github.com/IMSoP/php-src/commit/8dd601ac39a4241c9f119fd2d3e0e46474980a53 Good catch, I’ll handle that too. > Other than the awkward BC implications in gettype(), I see no reason that the user should ever > see the types labelled as "long" or "double" in their output. > > However, note that zend_get_type_by_const does get used in a handful of non-error contexts, > such as the ReflectionClass output shown in ext/reflection/tests/bug29986.phpt > [https://github.com/TazeTSchnitzel/php-src/commit/c0ee87297298b4ff9b8d68a01f8bbb99f94d9a10#diff-241] > I had a grep around and couldn't see any that were likely to cause any real concern, though. Yeah, that was the only manual test fix I did. That’s probably a small BC break for those people who are parsing __toString’s output. Thanks! -- Andrea Faulds http://ajf.me/

« previous php.internals (#79650) next »