On Mon, Feb 17, 2020 at 10:47 AM Mark Randall <marand...@php.net> wrote:
> On 17/02/2020 08:42, Nikita Popov wrote: > >> Can you please add some examples for the behavior? Preferably the > precise > >> output for all primitive types, for classes and for anonymous classes. > > Added to RFC > Thanks! I've taken the liberty of reformatting this into a table. Given the naming discussion, I think there's one important part to highlight here: For anonymous classes, this returns just "class@anonymous", not "class@anonymous\0SOME_RANDOM_UNIQUE_STRING_HERE". Thus this functionality certainly can't be under a ::type construct (which should return the full name), and even get_canonical_type() seems inappropriate. This function is specifically useful for including type names in error messages or similar, thus get_debug_type()... Nikita