Re: [PHP-DEV] [RFC] Simplified Array API for extensions

2014-08-11 Thread Andrea Faulds
On 12 Aug 2014, at 01:15, Tjerk Meesters wrote: > > On 12 Aug, 2014, at 5:03 am, Andrea Faulds wrote: > >> >> On 11 Aug 2014, at 22:00, Hannes Magnusson >> wrote: >> >>> I think it would be fantastic if this would be included in 5.6. >> >> Too late for 5.6, but 5.7 perhaps (can we please

Re: [PHP-DEV] [RFC] Simplified Array API for extensions

2014-08-11 Thread Tjerk Meesters
On 12 Aug, 2014, at 5:03 am, Andrea Faulds wrote: > > On 11 Aug 2014, at 22:00, Hannes Magnusson wrote: > >> I think it would be fantastic if this would be included in 5.6. > > Too late for 5.6, but 5.7 perhaps (can we please have this? 7 will break BC > and I’d like to get some stuff in ne

Re: [PHP-DEV] [RFC] Closure::call and Function Referencing as Closures

2014-08-11 Thread Josh Watzman
On Aug 10, 2014, at 11:20 AM, Andrea Faulds wrote: > Hi! > > Sorry for the slow response, I’ve been on holiday. No problem! > On 8 Aug 2014, at 01:32, Josh Watzman wrote: > >> The RFC goes a long way to fixing this, but one important place it misses is >> with function references to private

Re: [PHP-DEV] [RFC] Closure::call and Function Referencing as Closures

2014-08-11 Thread Dmitry Stogov
it's ambiguous with regular object creation. Thanks. Dmitry. On Tue, Aug 12, 2014 at 12:47 AM, Michael Wallner wrote: > How about 'new Function()'? > > Might be a WTF that it creates an instance of Closure, though. > On 11 Aug 2014 22:32, "Dmitry Stogov" wrote: > >> We didn't keep pointers t

Re: [PHP-DEV] [RFC] Simplified Array API for extensions

2014-08-11 Thread Sara Golemon
On Mon, Aug 11, 2014 at 2:03 PM, Andrea Faulds wrote: > On 11 Aug 2014, at 22:00, Hannes Magnusson wrote: >> I think it would be fantastic if this would be included in 5.6. >> > Too late for 5.6, but 5.7 perhaps (can we please have this? 7 will break BC > and I’d like to get some stuff in next y

Re: [PHP-DEV] [RFC] Simplified Array API for extensions

2014-08-11 Thread Andrea Faulds
On 11 Aug 2014, at 22:00, Hannes Magnusson wrote: > I think it would be fantastic if this would be included in 5.6. Too late for 5.6, but 5.7 perhaps (can we please have this? 7 will break BC and I’d like to get some stuff in next year, not in 2 years). -- Andrea Faulds http://ajf.me/ --

Re: [PHP-DEV] [RFC] Simplified Array API for extensions

2014-08-11 Thread Hannes Magnusson
I think it would be fantastic if this would be included in 5.6. -Hannes On Wed, Nov 6, 2013 at 2:14 PM, Hannes Magnusson wrote: > On Tue, Apr 2, 2013 at 7:52 PM, Sara Golemon wrote: >> https://wiki.php.net/rfc/php-array-api > > > Time to commit? > > -Hannes -- PHP Internals - PHP Runtime Deve

Re: [PHP-DEV] [RFC] Closure::call and Function Referencing as Closures

2014-08-11 Thread Michael Wallner
How about 'new Function()'? Might be a WTF that it creates an instance of Closure, though. On 11 Aug 2014 22:32, "Dmitry Stogov" wrote: > We didn't keep pointers to functions in opcodes (however it possible in > some cases). > Instead we use cache_slots in op_array->run_time_cache array to keep

Re: [PHP-DEV] [RFC] Closure::call and Function Referencing as Closures

2014-08-11 Thread Dmitry Stogov
We didn't keep pointers to functions in opcodes (however it possible in some cases). Instead we use cache_slots in op_array->run_time_cache array to keep pointers to classes and functions. Anyway, it must be quite easy to extend the patch. Thanks. Dmitry. On Mon, Aug 11, 2014 at 11:33 PM, Andre

Re: [PHP-DEV] [RFC] Closure::call and Function Referencing as Closures

2014-08-11 Thread Andrea Faulds
On 11 Aug 2014, at 20:07, Dmitry Stogov wrote: > > may be: > > $a = function strlen; > > or > > $a = function(stren); > > but these are not excellent as well :( I wanted to do the first, but it caused a shift/reduce conflict in the parser due to ambiguity with function () {}. The latter h

Re: [PHP-DEV] [RFC] Closure::call and Function Referencing as Closures

2014-08-11 Thread Dmitry Stogov
On Mon, Aug 11, 2014 at 10:09 PM, Andrea Faulds wrote: > > On 11 Aug 2014, at 08:36, Dmitry Stogov wrote: > > > Hi Andrea, > > > > Could you measure the performance impact of function referencing. > > > > > $func = "strlen"; > > for ($i = 0; $i < 1; $i++) { > > $func("hello"); > > } > >

Re: [PHP-DEV] [RFC] Closure::call and Function Referencing as Closures

2014-08-11 Thread Andrea Faulds
On 11 Aug 2014, at 08:36, Dmitry Stogov wrote: > Hi Andrea, > > Could you measure the performance impact of function referencing. > > $func = "strlen"; > for ($i = 0; $i < 1; $i++) { > $func("hello"); > } > ?> > > vs > > $func = &strlen; > for ($i = 0; $i < 1; $i++) { > $fu

Re: [PHP-DEV] Reflection to remove final

2014-08-11 Thread Marco Pivetta
On 11 August 2014 18:44, Chris Wright wrote: > I don't think that it even makes sense to have this as a possibility > for internal classes. > Even leaving everything else outside, I think internal classes should become less magic and more transparent over time. The current "fixing" of internal c

Re: [PHP-DEV] Reflection to remove final

2014-08-11 Thread Chris Wright
On 11 August 2014 17:09, Julien Pauli wrote: > On Mon, Aug 11, 2014 at 12:59 PM, Ferenc Kovacs wrote: >> On Sat, Aug 9, 2014 at 12:35 PM, Tom Oram wrote: >> >>> I've just been looking back at the history of this previous conversation... >>> >>> http://marc.info/?l=php-internals&m=132673741606531

Re: [PHP-DEV] Regarding PHP-FPM protocols

2014-08-11 Thread Julien Pauli
On Sat, Aug 9, 2014 at 6:43 AM, Aaron Lewis wrote: > Hi, > > I'm trying to understand how php-fpm works, aka how does nginx > "forward" the request to it. > > Now I want an example program that do it or the document that explains it. > Anyone know where to get those? Hey, This is all about the F

Re: [PHP-DEV] Reflection to remove final

2014-08-11 Thread Julien Pauli
On Mon, Aug 11, 2014 at 12:59 PM, Ferenc Kovacs wrote: > On Sat, Aug 9, 2014 at 12:35 PM, Tom Oram wrote: > >> I've just been looking back at the history of this previous conversation... >> >> http://marc.info/?l=php-internals&m=132673741606531&w=2 >> >> as a mockist tester I'd really REALLY like

Re: [PHP-DEV] Re: PHPNG crashes when using composer

2014-08-11 Thread Ferenc Kovacs
On Mon, Aug 11, 2014 at 4:22 PM, Pascal Chevrel wrote: > Le 11/08/2014 16:10, Laruence a écrit : > > Hey: >> >> >> >> On Mon, Aug 11, 2014 at 10:07 PM, Pascal Chevrel >> wrote: >> >>> Le 01/08/2014 13:58, Pascal Chevrel a écrit : >>> >>> Hi Another bug I found: https://bugs.php.net/b

Re: [PHP-DEV] Re: PHPNG crashes when using composer

2014-08-11 Thread Pascal Chevrel
Le 11/08/2014 16:10, Laruence a écrit : Hey: On Mon, Aug 11, 2014 at 10:07 PM, Pascal Chevrel wrote: Le 01/08/2014 13:58, Pascal Chevrel a écrit : Hi Another bug I found: https://bugs.php.net/bug.php?id=67735 When running "composer update" on a project I participate in (https://github.co

Re: [PHP-DEV] Re: PHPNG crashes when using composer

2014-08-11 Thread Laruence
Hey: On Mon, Aug 11, 2014 at 10:07 PM, Pascal Chevrel wrote: > Le 01/08/2014 13:58, Pascal Chevrel a écrit : > >> Hi >> >> Another bug I found: https://bugs.php.net/bug.php?id=67735 >> >> When running "composer update" on a project I participate in >> (https://github.com/framasoft/framadate), P

[PHP-DEV] Re: PHPNG crashes when using composer

2014-08-11 Thread Pascal Chevrel
Le 01/08/2014 13:58, Pascal Chevrel a écrit : Hi Another bug I found: https://bugs.php.net/bug.php?id=67735 When running "composer update" on a project I participate in (https://github.com/framasoft/framadate), PHPNG crashes. Regards Pascal Regarding this bug, can somebody answer my questio

[PHP-DEV] Fwd: PHP RFC: Scalar type-hinting with cast

2014-08-11 Thread Andrea Faulds
Begin forwarded message: > From: Andrea Faulds > Subject: Re: PHP RFC: Scalar type-hinting with cast > Date: 11 August 2014 13:46:05 BST > To: Benjamin Morel > > > On 11 Aug 2014, at 13:41, Benjamin Morel wrote: > >> Hi, >> >> I’m a strong supporter of this feature request, so first of al

Re: [PHP-DEV] [RFC] Closure::call and Function Referencing as Closures

2014-08-11 Thread Andrea Faulds
On 11 Aug 2014, at 12:08, Rowan Collins wrote: > I understand that &$foo->method won't work, but that's what I mean by > pre-supposing the proposed syntax. > > If you had a different syntax, such as £function (I know it's not a sensible > choice, but it's an example of something with no confl

Re: [PHP-DEV] [RFC] Closure::call and Function Referencing as Closures

2014-08-11 Thread Rowan Collins
Andrea Faulds wrote (on 10/08/2014): On 10 Aug 2014, at 22:00, Rowan Collins wrote: You're rather pre-supposing the proposed syntax there, and letting it lead the semantics rather than vice versa. The point is it would be useful to allow creation of a pre-bound closure based on an existing m

Re: [PHP-DEV] Reflection to remove final

2014-08-11 Thread Ferenc Kovacs
On Sat, Aug 9, 2014 at 12:35 PM, Tom Oram wrote: > I've just been looking back at the history of this previous conversation... > > http://marc.info/?l=php-internals&m=132673741606531&w=2 > > as a mockist tester I'd really REALLY like to see this be possible but I > can see the problem with the or

Re: [PHP-DEV] Reflection to remove final

2014-08-11 Thread Chris Wright
On 11 August 2014 11:30, Chris Wright wrote: > Hi Tom > > On 9 August 2014 11:35, Tom Oram wrote: >> I've just been looking back at the history of this previous conversation... >> >> http://marc.info/?l=php-internals&m=132673741606531&w=2 >> >> as a mockist tester I'd really REALLY like to see th

Re: [PHP-DEV] Reflection to remove final

2014-08-11 Thread Marco Pivetta
Hi Tom, On 9 August 2014 12:35, Tom Oram wrote: > Thoughts? > Possible? Probably, yes. I'd actually argue that it may not be a good solution: it seems to me that if you have to resort to this kind of mocking, then someone type-hinted against a concrete implementation, which is a smell. Shouldn

Re: [PHP-DEV] Reflection to remove final

2014-08-11 Thread Chris Wright
Hi Tom On 9 August 2014 11:35, Tom Oram wrote: > I've just been looking back at the history of this previous conversation... > > http://marc.info/?l=php-internals&m=132673741606531&w=2 > > as a mockist tester I'd really REALLY like to see this be possible but I > can see the problem with the orig

Re: [PHP-DEV] [RFC] Closure::call and Function Referencing as Closures

2014-08-11 Thread Dmitry Stogov
Hi Andrea, Could you measure the performance impact of function referencing. vs I don't like the "&" syntax a lot, but I understand that it's a compromise between readability and implementation complication. The patch probably misses support for "&self::foo", "&parent::foo", "&static::foo".