Re: Invokation on __toString() for object used as array key
| From: | Florian Margaine | Date: | Thu, 25 Sep 2014 10:57:41 +0000 |
| Subject: | Re: Invokation on __toString() for object used as array key | ||
| 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-77624@lists.php.net to get a copy of this message | ||
Le 25 sept. 2014 12:54, "Pierre Joye" <pierre.php@gmail.com> a écrit :
>
> On Thu, Sep 25, 2014 at 12:22 PM, Florian Margaine <florian@margaine.com>
wrote:
> > Hi,
> >
> > Joe Watkins wrote (for fun) a new operator,
addressof.
> > Code is here:
> > https://github.com/krakjoe/php-src/compare/addressof
> >
> > I think it makes more sense than a new method on all objects. You could
use
> > it for any kind of value: scalar, resource, object. Building an array of
> > sockets, for example, would be very easy with such an operator.
> >
> > It would also give better tools to deal with situations such as:
> >
> > $test = 1;
> > $test2 &= $test;
> >
> > I'm willing to write an RFC if necessary to include it.
> >
> > Thoughts?
> ´
> Not sure what is the relation with resource as objects but I am not
> sure either about exposing the internal position to the userland. That
> will pretty much forces to keep it this way forever if we expose it
> for anything but debugging.
The thing is, we already expose it through references, but we don't give
any tool to help people debug them.
>
> Cheers,
> --
> Pierre
>
> @pierrejoye | http://www.libgd.org