> Unfortunately, this implementation goes in the wrong direction: PHP already 
> has full internal support for operator overloading through the do_operation 
> object handler. Operator overloading should be exposed to  userland through 
> that handler as well.

I have made another implementation 
(https://github.com/jbtronics/php-src/tree/operator_overloading) which provides 
an standard handler for do_operation, which calls the functions in user space.

I also removed the __compare magic function from my implementation, so this can 
be handled separately.

Another thing: What are your opinions on overload the bitwise not operator (~)? 
My implementations offers every other bitwise operator and this one would 
complete the set of bitwise operators. On the other hand unary operators does 
not have much use for objects and maybe encourage people using them as 
"shortcut" for calling things on the object, where an explicit method call 
would make the intend function more clear.

Regards,
Jan

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

Reply via email to