Re: [PHP-DEV] RFC Operator Overloading in Userspace

2016-01-02 Thread Sara Golemon
> 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)

Re: [PHP-DEV] RFC Operator Overloading in Userspace

2016-01-02 Thread Stanislav Malyshev
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

Re: [PHP-DEV] RFC Operator Overloading in Userspace

2016-01-02 Thread Levi Morrison
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

Re: [PHP-DEV] RFC Operator Overloading in Userspace

2016-01-02 Thread John Bafford
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

Re: [PHP-DEV] RFC Operator Overloading in Userspace

2016-01-02 Thread Sara Golemon
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

Re: [PHP-DEV] RFC Operator Overloading in Userspace

2016-01-02 Thread Stanislav Malyshev
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

Re: [PHP-DEV] RFC Operator Overloading in Userspace

2016-01-02 Thread Bishop Bettini
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

Re: [PHP-DEV] RFC Operator Overloading in Userspace

2016-01-02 Thread Davey Shafik
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

[PHP-DEV] RFC Operator Overloading in Userspace

2016-01-02 Thread Sara Golemon
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

Re: [PHP-DEV] [RFC] On-Demand Name Mangling

2016-01-02 Thread Rowan Collins
On 02/01/2016 03:09, Bishop Bettini wrote: But, even without a setting, there's an escape hatch: userland can polyfill the mangling behavior using extract. The updated RFC demonstrates an algorithm. I'm not that comfortable with requiring / encouraging the use of extract() - a rather awkward

[PHP-DEV] Re: Line numbers for "finally"

2016-01-02 Thread Xinchen Hui
Hey: On Sat, Jan 2, 2016 at 7:59 PM, Derick Rethans wrote: > On Thu, 31 Dec 2015, Nikita Popov wrote: > > > On Thu, Dec 31, 2015 at 1:09 AM, Derick Rethans wrote: > > > > > On Thu, 31 Dec 2015, Nikita Popov wrote: > > > > > > > For PHP 7 only: FAST_CALL always jumps to op1. op2 is not a jmp >

[PHP-DEV] Re: Line numbers for "finally"

2016-01-02 Thread Derick Rethans
On Thu, 31 Dec 2015, Nikita Popov wrote: > On Thu, Dec 31, 2015 at 1:09 AM, Derick Rethans wrote: > > > On Thu, 31 Dec 2015, Nikita Popov wrote: > > > > > For PHP 7 only: FAST_CALL always jumps to op1. op2 is not a jmp > > > addr, it's a try_catch_array offset. For FAST_RET there are no > > >