Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-12 Thread Niklas Keller
2015-11-11 14:44 GMT+01:00 Derick Rethans : > On Wed, 11 Nov 2015, Nikita Popov wrote: > > > Using a NUL byte conveniently achieves both of these goals. We did not > > however take into account that this would cause issues with 3rd party > > tooling that does not support binary data. > > I withdra

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-11 Thread Derick Rethans
On Wed, 11 Nov 2015, Nikita Popov wrote: > Using a NUL byte conveniently achieves both of these goals. We did not > however take into account that this would cause issues with 3rd party > tooling that does not support binary data. I withdraw my comment. It does not cause issues for me (anymore)

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-11 Thread Rowan Collins
Steven Hilder wrote on 11/11/2015 02:13: This behaviour was present in Joe's original implementation, but later removed[3] by Nikita. His commit message says that this was "dead code", but I don't see what was wrong with it. It looks to me like 'decl->name' will never be set for an anonymous

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-11 Thread Nikita Popov
On Tue, Nov 10, 2015 at 11:04 PM, Steven Hilder < steven.hilder@sevenpercent.solutions> wrote: On Mon, 09 Nov 2015 16:48:57, Leigh wrote: > >> On 9 November 2015 at 15:27, Steven Hilder >> Can you share your patch? >> > > See > https://github.com/php/php-src/compare/master...stevenhilder:hide-ano

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-10 Thread Steven Hilder
On Wed, 11 Nov 2015 01:06:32, Andrea Faulds wrote: This is mostly tangential, but I note that we use "{closure}" as the name of anonymous functions. So, maybe it should be "{class}@..." for anonymous classes? It's at least semi-consistent... Hi Andrea, Only slightly tangential - I'm intere

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-10 Thread Andrea Faulds
Hi Derick, Derick Rethans wrote: I would suggest replacing it with something else. As I am making this work for Xdebug, I really need to ship the full name to the IDE so that they can later do look-ups on anonymous class properties, and with the \0 the IDEs seem to fuck this up. I suggest using

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-10 Thread Steven Hilder
On Mon, 09 Nov 2015 16:48:57, Leigh wrote: On 9 November 2015 at 15:27, Steven Hilder Can you share your patch? See https://github.com/php/php-src/compare/master...stevenhilder:hide-anon-class-suffix Feedback very welcome :) It should be possible to return the sanitised name without remo

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-09 Thread Adam Harvey
On 9 November 2015 at 13:46, Derick Rethans wrote: > On Thu, 5 Nov 2015, Niklas Keller wrote: > >> I discovered today that anonymous class names contain a null byte >> right after "class@anonymous". I don't think class names should >> contain non-printable characters. >> >> How about removing that

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-09 Thread Derick Rethans
On Thu, 5 Nov 2015, Niklas Keller wrote: > I discovered today that anonymous class names contain a null byte > right after "class@anonymous". I don't think class names should > contain non-printable characters. > > How about removing that null byte? I would suggest replacing it with something

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-09 Thread Niklas Keller
2015-11-09 17:46 GMT+01:00 Leigh : > > On 9 November 2015 at 16:42, Niklas Keller wrote: > >> >> Having the path info is quite useful for debugging purposes. >> >> Regards, Niklas >> > > It is, but it will always still be available from > ReflectionClass::getFileName() > But most implementations

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-09 Thread Leigh
On 9 November 2015 at 15:27, Steven Hilder > > > So, I prepared a patch for `get_class()` and `ReflectionClass::getName()`, > which in my view should behave the same way as `var_dump()` etc., but I've > now realised that ignoring the unique suffix from the class name will break > functionality that

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-09 Thread Leigh
On 9 November 2015 at 16:42, Niklas Keller wrote: > > Having the path info is quite useful for debugging purposes. > > Regards, Niklas > It is, but it will always still be available from ReflectionClass::getFileName()

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-09 Thread Niklas Keller
2015-11-09 16:27 GMT+01:00 Steven Hilder < steven.hilder@sevenpercent.solutions>: > On Thu, 05 Nov 2015 15:14:47, Leigh wrote: > >> On 5 November 2015 at 14:59, Rowan Collins >> wrote: >> >>> PHP uses null bytes quite a lot to produce deliberately illegal >>> identifiers. For instance the old ev

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-09 Thread Steven Hilder
On Thu, 05 Nov 2015 15:14:47, Leigh wrote: On 5 November 2015 at 14:59, Rowan Collins wrote: PHP uses null bytes quite a lot to produce deliberately illegal identifiers. For instance the old eval-like create_function() [e.g. https://3v4l.org/hqHjh] and the serialization of private members [e.g

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-06 Thread Niklas Keller
Problem is that e.g. exception to string casts do not handle it properly, there may be other affected areas. https://3v4l.org/e9AGZ Regards, Niklas 2015-11-05 16:14 GMT+01:00 Leigh : > On 5 November 2015 at 14:59, Rowan Collins > wrote: > > > > > PHP uses null bytes quite a lot to produce deli

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-05 Thread Leigh
On 5 November 2015 at 14:59, Rowan Collins wrote: > > PHP uses null bytes quite a lot to produce deliberately illegal > identifiers. For instance the old eval-like create_function() [e.g. > https://3v4l.org/hqHjh] and the serialization of private members [e.g. > https://3v4l.org/R6Y6k] > > In thi

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-05 Thread Rowan Collins
On 05/11/2015 14:21, Niklas Keller wrote: Hello, I discovered today that anonymous class names contain a null byte right after "class@anonymous". I don't think class names should contain non-printable characters. How about removing that null byte? https://3v4l.org/QUKpV https://github.com/php

Re: [PHP-DEV] Null bytes in anonymous class names

2015-11-05 Thread Leigh
On 5 November 2015 at 14:21, Niklas Keller wrote: > Hello, > > I discovered today that anonymous class names contain a null byte right > after "class@anonymous". I don't think class names should contain > non-printable characters. > > How about removing that null byte? > > https://3v4l.org/QUKpV

[PHP-DEV] Null bytes in anonymous class names

2015-11-05 Thread Niklas Keller
Hello, I discovered today that anonymous class names contain a null byte right after "class@anonymous". I don't think class names should contain non-printable characters. How about removing that null byte? https://3v4l.org/QUKpV https://github.com/php/php-src/blob/da8e6ec4a5063d9f60f83f43c55bc1