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

Nobody talks about "new method on all objects" (it's also not really
possible in PHP). We're talking about new magic method, which allows the
developer to control how class is treated when used as hash key. Note it
is not always the same as object's identity - you may want two GMP
numbers with value of "1" actually refer to the same key in the hash,
just like two numbers 1 do.

> 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.

Building an array of sockets is easy right now. Same with array of any
variables. What is not easy is using socket as an index, but why exactly
would you want to do that?

> It would also give better tools to deal with situations such as:
> 
> $test = 1;
> $test2 &= $test;

Why it is the situation that must be dealt with?

-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to