Re: [PHP-DEV] [RFC] Reflection for references

2019-01-28 Thread Nicolas Grekas
> > I'd like to move forward with the RFC as is -- I'm uncomfortable with > switching this to a simple XOR for security reasons. I think we should > start off with the current implementation, with the option of switching to > an integer return value at a later time. > Works for me, thank you! Nic

Re: [PHP-DEV] [RFC] Reflection for references

2019-01-28 Thread Nikita Popov
On Tue, Jan 15, 2019 at 1:42 PM Nikita Popov wrote: > On Tue, Jan 15, 2019 at 1:09 PM Nicolas Grekas < > nicolas.grekas+...@gmail.com> wrote: > >> About using "int" as return type for getId(): >> >> > * Can the `getId()` return type be restricted to either `int` or >>> > `string`? Why is it a un

Re: [PHP-DEV] [RFC] Reflection for references

2019-01-17 Thread Nikita Popov
On Thu, Jan 17, 2019 at 6:48 AM Stanislav Malyshev wrote: > Hi! > > > I'd like to propose the addition of a ReflectionReference class, as > > described in the following RFC: > > https://wiki.php.net/rfc/reference_reflection > > Do I understand correctly that the main use case here is to know if t

Re: [PHP-DEV] [RFC] Reflection for references

2019-01-16 Thread Stanislav Malyshev
Hi! > I'd like to propose the addition of a ReflectionReference class, as > described in the following RFC: > https://wiki.php.net/rfc/reference_reflection Do I understand correctly that the main use case here is to know if two variables (treating this term expansively) point, by reference, to th

Re: [PHP-DEV] [RFC] Reflection for references

2019-01-15 Thread Nikita Popov
On Tue, Jan 15, 2019 at 1:09 PM Nicolas Grekas wrote: > About using "int" as return type for getId(): > > > * Can the `getId()` return type be restricted to either `int` or >> > `string`? Why is it a union type right now? Technical limitation? >> >> To allow changes in the future. The real retur

Re: [PHP-DEV] [RFC] Reflection for references

2019-01-15 Thread Nicolas Grekas
About using "int" as return type for getId(): > * Can the `getId()` return type be restricted to either `int` or > > `string`? Why is it a union type right now? Technical limitation? > > To allow changes in the future. The real return value here is an int, but > the size increase due to hashing m

Re: [PHP-DEV] [RFC] Reflection for references

2019-01-15 Thread Marco Pivetta
On Tue, Jan 15, 2019 at 11:57 AM Nikita Popov wrote: > > * instead of `$ref1->getId() === $ref2->getId()`, `$ref1->matches($ref2)` >> or such. >> > * what are possible scenarios for getting the identifier as a primitive, >> and then storing it somewhere (like an array of reference identifiers)?

Re: [PHP-DEV] [RFC] Reflection for references

2019-01-15 Thread Nikita Popov
On Tue, Jan 15, 2019 at 11:30 AM Marco Pivetta wrote: > A few issues with the RFC so far: > > * `ReflectionReference` seems to be designed around arrays only: maybe > `ReflectionArrayKeyReference` or such? > ReflectionReference works with arbitrary references. Arrays only come in as a detail of

Re: [PHP-DEV] [RFC] Reflection for references

2019-01-15 Thread Nicolas Grekas
Thank you Nikita, I will definitely need that RFC! Answering to Marco: * `ReflectionReference` seems to be designed around arrays only: maybe > `ReflectionArrayKeyReference` or such? > I agree with the wording in the RFC: the array is the primitive data structure in PHP that holds references.

Re: [PHP-DEV] [RFC] Reflection for references

2019-01-15 Thread Marco Pivetta
A few issues with the RFC so far: * `ReflectionReference` seems to be designed around arrays only: maybe `ReflectionArrayKeyReference` or such? * Can the `getId()` return type be restricted to either `int` or `string`? Why is it a union type right now? Technical limitation? * `ReflectionReferen