> Am 05.01.2016 um 15:29 schrieb Alexander Lisachenko :
>
> 2016-01-05 2:04 GMT+03:00 Andrea Faulds :
>
>> I agree that we could do something with interfaces. I would like to point
>> out that we actually already have an example of this, in the form of the
>> \ArrayAccess interface, which requir
> Am 4.1.2016 um 20:39 schrieb Johannes Schlüter :
>
> On Sat, 2016-01-02 at 18:14 -0800, Sara Golemon wrote:
>> https://wiki.php.net/rfc/operator-overloading
>
> Back in the days when I created the first implementation of operator
> overloading in the engine[1] I didn't see it fit for the langua
On Sat, 2016-01-02 at 18:14 -0800, Sara Golemon wrote:
> https://wiki.php.net/rfc/operator-overloading
Back in the days when I created the first implementation of operator
overloading in the engine[1] I didn't see it fit for the language.
Meanwhile we have more type hints and stuff making it a bit
Hi,
I did consider that as an alternate option.
function overload_register($op, $lhtype, $rhtype, $callback);
overload_type(ZEND_ADD, 'Complex', 'any', 'Complex::add');
This would get pretty expensive in terms of large lookup tables though, so I'm
hesitant there.
This is much better, IMO, as
On Sat, 2 Jan 2016, Sara Golemon wrote:
> Patricio Tarantino has asked me to help him propose Operator
> Overloading in PHP 7.1 (based in part on my operator extension in
> PECL). I think we can expose this to usespace as magic methods with
> very little overhead (the runtime check and dispatch i
On 01/02/2016 08:14 PM, Sara Golemon wrote:
Patricio Tarantino has asked me to help him propose Operator
Overloading in PHP 7.1 (based in part on my operator extension in
PECL). I think we can expose this to usespace as magic methods with
very little overhead (the runtime check and dispatch is a
> On Jan 3, 2016, at 02:11, Nikita Popov wrote:
> Thanks for the proposal, Sara! A few questions to clarify:
>
One point of order. It's Patricio's peoposal, I'm just helping him move it
along.
> 1. If an object implements __add__, will $a += $b be equivalent to $a =
> $a->__add($b) and ++$a
On 03/01/2016 02:14, Sara Golemon wrote:
Patricio Tarantino has asked me to help him propose Operator
Overloading in PHP 7.1 (based in part on my operator extension in
PECL). I think we can expose this to usespace as magic methods with
very little overhead (the runtime check and dispatch is alre
On Sun, Jan 3, 2016 at 3:14 AM, Sara Golemon wrote:
> Patricio Tarantino has asked me to help him propose Operator
> Overloading in PHP 7.1 (based in part on my operator extension in
> PECL). I think we can expose this to usespace as magic methods with
> very little overhead (the runtime check a
> BTW, I don't think for GMP right now += modifies existing object.
> I guess it may be possible to implement it the other way (not sure).
>
It doesn't. As seen below, we get a new, second object on the
assign_add. Wrong behavior IMO, but something to fix separately from
this.
$g = gmp_init(123)
Hi!
> Hilarious to hear you cite that as the already existing inconsistency
> between += and ++ with non-numeric strings came up only last week.
>
> $x = 'foo';
> $x++; // $x === 'fop'
> $x += 1; // $x === 1
Exactly, because on strings ++ and += 1 are not the same operator. And,
as you noted, it
On Sat, Jan 2, 2016 at 7:14 PM, Sara Golemon wrote:
> Patricio Tarantino has asked me to help him propose Operator
> Overloading in PHP 7.1 (based in part on my operator extension in
> PECL). I think we can expose this to usespace as magic methods with
> very little overhead (the runtime check an
Hi Sara,
On Jan 2, 2016, at 21:14, Sara Golemon wrote:
>
> Patricio Tarantino has asked me to help him propose Operator
> Overloading in PHP 7.1 (based in part on my operator extension in
> PECL). I think we can expose this to usespace as magic methods with
> very little overhead (the runtime c
On Sat, Jan 2, 2016 at 6:59 PM, Stanislav Malyshev wrote:
>> Patricio Tarantino has asked me to help him propose Operator
>> Overloading in PHP 7.1 (based in part on my operator extension in
>> PECL). I think we can expose this to usespace as magic methods with
>> very little overhead (the runtim
Hi!
> Patricio Tarantino has asked me to help him propose Operator
> Overloading in PHP 7.1 (based in part on my operator extension in
> PECL). I think we can expose this to usespace as magic methods with
> very little overhead (the runtime check and dispatch is already there,
> after all).
We c
Hi Sara and Patricio,
On Sat, Jan 2, 2016 at 9:14 PM, Sara Golemon wrote:
> Patricio Tarantino has asked me to help him propose Operator
> Overloading in PHP 7.1 (based in part on my operator extension in
> PECL). I think we can expose this to usespace as magic methods with
> very little overhe
I would love to see all of the is_* methods implemented in the initial
implementation, these are far more useful to me than the basic math
operators.
As for interfaces, I'm generally pro-interfaces as programmatic
documentation if nothing else — however, none of the magic methods have
implemented
Patricio Tarantino has asked me to help him propose Operator
Overloading in PHP 7.1 (based in part on my operator extension in
PECL). I think we can expose this to usespace as magic methods with
very little overhead (the runtime check and dispatch is already there,
after all).
I do think that the
18 matches
Mail list logo