[PHP-DEV] Re: [RFC Discussion] Precise session management

2016-02-25 Thread Yasuo Ohgaki
Hi all, On Sun, Feb 14, 2016 at 9:49 AM, Yasuo Ohgaki wrote: > > It's been long time since the first proposal. Since session > module is important module for Web apps, I would like to > hear opinions for this RFC once again before vote. > > RFC > https://wiki.php.net/rfc/precise_session_managemen

Re: [PHP-DEV] [RFC Proposal] var keyword deprecation/removal

2016-02-25 Thread Michael Wallner
> On 18 02 2016, at 20:33, Andrea Faulds wrote: > > Hi Colin, > > Colin O'Dell wrote: >> I'd like to propose an RFC to deprecate and eventually remove the "var" >> keyword. > > I don't have a strong opinion on that, I guess I'm in favour. It seems like a > fairly harmless deprecation. > > Th

Re: [PHP-DEV] [RFC] Callable constructors

2016-02-25 Thread Adam Harvey
On 25 February 2016 at 14:19, Dan Ackroyd wrote: > On 25 February 2016 at 18:16, Adam Harvey wrote: >> >> am I right >> that this is equivalent to the following? >> >>$injector->delegate('FooInterface', function (...$args) { return new > FooImplementation(...$args); }); > > Nope. > > The vital pa

Re: [PHP-DEV] [RFC] Callable constructors

2016-02-25 Thread Dan Ackroyd
On 25 February 2016 at 18:16, Adam Harvey wrote: > > am I right > that this is equivalent to the following? > >$injector->delegate('FooInterface', function (...$args) { return new FooImplementation(...$args); }); Nope. The vital part you missed is that with the original function, all of the para

Re: [PHP-DEV] [RFC] Callable constructors

2016-02-25 Thread Dan Ackroyd
On 25 February 2016 at 18:32, Ryan Pallas wrote: > If fetchAll is coming from PDO. then you could have simply done this: > > $records = $db->someQuery()->fetchAll(MyRecord::class); That is a great argument as to why constructors should be callable without using the 'new'. It's been possible to d

Re: [PHP-DEV] [RFC Proposal] var keyword deprecation/removal

2016-02-25 Thread Yasuo Ohgaki
Hi all, On Fri, Feb 26, 2016 at 3:10 AM, Fleshgrinder wrote: > On 2/25/2016 10:26 AM, Tony Marston wrote: >>> Science shows that it is harmful, let's clean it up! >> >> Your "proof" is not scientific, it is just personal opinion. There is no >> evidence that use of the "var" keyword is harmful in

RE: [PHP-DEV] PCRE jit bug with UTF-8 and lookbehind assertion

2016-02-25 Thread Anatol Belski
Hi Ángel, > -Original Message- > From: Ángel González [mailto:keis...@gmail.com] > Sent: Thursday, February 25, 2016 9:12 PM > To: Anatol Belski > Cc: 'Christian Schneider' ; 'PHP internals' > > Subject: Re: [PHP-DEV] PCRE jit bug with UTF-8 and lookbehind assertion > > On 21/02/16 11:4

Re: [PHP-DEV] Re: [RFC] Callable constructors

2016-02-25 Thread Rowan Collins
On 25/02/2016 17:40, Andrea Faulds wrote: Dan Ackroyd wrote: I've written a small RFC to make it possible to call constructors of objects as a callable, rather than only being able to call them through the 'new' language construct. https://wiki.php.net/rfc/callableconstructors While I like th

Re: [PHP-DEV] PCRE jit bug with UTF-8 and lookbehind assertion

2016-02-25 Thread Ángel González
On 21/02/16 11:42, Anatol Belski wrote: Were you putting the snippets into a file or testing on the console? I had an issue while testing this on the console, that some chars was partially swallowed by terminal (which was a utf-8 terminal). When putting into a file, the output is same for both

Re: [PHP-DEV] [RFC] Callable constructors

2016-02-25 Thread Ryan Pallas
On Thu, Feb 25, 2016 at 11:31 AM, Ryan Pallas wrote: > > > On Thu, Feb 25, 2016 at 11:20 AM, Marco Pivetta > wrote: > >> Just adding to the use-cases: I really could've needed this the other day: >> >> >> $records = array_map([MyRecord::class, '__construct'], >> $db->someQuery()->fetchAll()); >>

Re: [PHP-DEV] [RFC] Callable constructors

2016-02-25 Thread Marco Pivetta
On 25 February 2016 at 13:31, Ryan Pallas wrote: > > > On Thu, Feb 25, 2016 at 11:20 AM, Marco Pivetta > wrote: > >> Just adding to the use-cases: I really could've needed this the other day: >> >> >> $records = array_map([MyRecord::class, '__construct'], >> $db->someQuery()->fetchAll()); >> >>

Re: [PHP-DEV] [RFC] Callable constructors

2016-02-25 Thread Ryan Pallas
On Thu, Feb 25, 2016 at 11:20 AM, Marco Pivetta wrote: > Just adding to the use-cases: I really could've needed this the other day: > > > $records = array_map([MyRecord::class, '__construct'], > $db->someQuery()->fetchAll()); > > I used a named constructor instead, but this results with more inte

Re: [PHP-DEV] [RFC] Callable constructors

2016-02-25 Thread Ryan Pallas
On Thu, Feb 25, 2016 at 9:44 AM, Dan Ackroyd wrote: > Hello internals, > > I've written a small RFC to make it possible to call constructors of > objects as a callable, rather than only being able to call them > through the 'new' language construct. > > https://wiki.php.net/rfc/callableconstructo

Re: [PHP-DEV] [RFC] Callable constructors

2016-02-25 Thread Marco Pivetta
Just adding to the use-cases: I really could've needed this the other day: $records = array_map([MyRecord::class, '__construct'], $db->someQuery()->fetchAll()); I used a named constructor instead, but this results with more internal method calls: $records = array_map([MyRecord::class, 'fromResu

Re: [PHP-DEV] Re: [RFC] Callable constructors

2016-02-25 Thread Adam Harvey
On 25 February 2016 at 09:40, Andrea Faulds wrote: > Instead of changing __construct to implicitly create the object it acts on > in certain contexts, I would suggest a simpler approach: add a magic ::new() > static method that exists on all classes (think ::class, although that is a > constant).

Re: [PHP-DEV] [RFC] Callable constructors

2016-02-25 Thread Adam Harvey
On 25 February 2016 at 08:44, Dan Ackroyd wrote: > I use the Auryn* DIC library. What I've wanted to do, and should be > able to do in my opinion, is this: > > $injector->delegate('FooInterface', 'FooImplementation::__construct'); I only skimmed the RFC (and am unfamiliar with Auryn beyond glanci

Re: [PHP-DEV] [RFC Proposal] var keyword deprecation/removal

2016-02-25 Thread Fleshgrinder
On 2/25/2016 10:26 AM, Tony Marston wrote: >> Science shows that it is harmful, let's clean it up! > > Your "proof" is not scientific, it is just personal opinion. There is no > evidence that use of the "var" keyword is harmful in any way. I think the diverged from talking about the "var" keyword

[PHP-DEV] Re: [RFC] Callable constructors

2016-02-25 Thread Andrea Faulds
Hi Dan, Dan Ackroyd wrote: I've written a small RFC to make it possible to call constructors of objects as a callable, rather than only being able to call them through the 'new' language construct. https://wiki.php.net/rfc/callableconstructors While I like the concept, I dislike the execution

[PHP-DEV] UGLY Benchmark Results for PHP Master 2016-02-25

2016-02-25 Thread lp_benchmark_robot
Results for project PHP master, build date 2016-02-25 06:31:41+02:00 commit: a1c9bd8 previous commit:85ade00 revision date: 2016-02-24 22:35:14+01:00 environment:Haswell-EP cpu:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB

[PHP-DEV] [RFC] Callable constructors

2016-02-25 Thread Dan Ackroyd
Hello internals, I've written a small RFC to make it possible to call constructors of objects as a callable, rather than only being able to call them through the 'new' language construct. https://wiki.php.net/rfc/callableconstructors After gathering informal feedback for the RFC, one person said

Re: [PHP-DEV] Fw: unpack()

2016-02-25 Thread Leigh
On 25 February 2016 at 13:02, Dmitry Stogov wrote: > > I've just got to know about possible usage of "@" in unpack(), but it seems > doesn't work at all > > $ sapi/cli/php -r 'var_dump(unpack("@0l", "\x01\x00\x00\x00")); ' > array(0) { > } > > Do I use it properly? > > Thanks. Dmitry. > As Nikita

[PHP-DEV] Change in internal call_user_function() API.

2016-02-25 Thread Dmitry Stogov
Hi, PHP-7.0 internal call_user_function() API doesn't support function calls with preinitialised symbol tables. This just can't work in general , because values of arguments might be already initialized in CV as well as in symbol table. I propose to remove the corresponding internal API in m

Re: [PHP-DEV] Fw: unpack()

2016-02-25 Thread Hynek Bartoš
This is a good point, so I checked my old source codes and I found a note in one of them, that: unpack('@200/'. 'aA', str_repeat(' ', 200). 'ABC') was returning 'B' instead of 'A'. It is some issue which probably was repaired years ago (because it works correctly now), but it allowed me t

Re: [PHP-DEV] Re: [RFC] [DRAFT]: Consistent callables

2016-02-25 Thread Nicolas Grekas
> https://wiki.php.net/rfc/consistent_callables Personally, I do use "colon separated string" to e.g. put callables as keys in an array (when of course the array definition I'm writing is fine with static callables). The reasons written in the RFC seem very weak compared to breaking code that wo

[PHP-DEV] Re: [RFC] [DRAFT]: Consistent callables

2016-02-25 Thread Dan Ackroyd
On 29 September 2015 at 14:25, Dan Ackroyd wrote: > Hello internals, > > Here is a draft RFC to make the callable type in PHP be consistent and > have much fewer surprises. > > https://wiki.php.net/rfc/consistent_callables Hello again, I'd like to give everyone an update on the 'Consitent Calla

Re: [PHP-DEV] Fw: unpack()

2016-02-25 Thread Hynek Bartoš
Hello all! It all depends on usage of this function. My suggestion pointed to the situation when you have some structures inside binary stream (similar to C struct), so you have constant $format argument. The usage of '@' should be relative to the start of the parsing so it should start at the offs

Re: [PHP-DEV] Fw: unpack()

2016-02-25 Thread Nikita Popov
On Thu, Feb 25, 2016 at 2:02 PM, Dmitry Stogov wrote: > > > On 02/25/2016 03:05 PM, Nikita Popov wrote: > > On Thu, Feb 25, 2016 at 8:08 AM, Dmitry Stogov wrote: > >> >> >> >> >> From: Dmitry Stogov >> Sent: Wednesday, February 24, 2016 13:35 >> To: Hynek Bartoš;

Re: [PHP-DEV] Fw: unpack()

2016-02-25 Thread Dmitry Stogov
On 02/25/2016 03:05 PM, Nikita Popov wrote: On Thu, Feb 25, 2016 at 8:08 AM, Dmitry Stogov > wrote: From: Dmitry Stogov Sent: Wednesday, February 24, 2016 13:35 To: Hynek Bartoš; php-...@lists.php.net

Re: [PHP-DEV] Re: [RFC] Traits with interfaces

2016-02-25 Thread Chris Riley
On 24 February 2016 at 22:04, Chase Peeler wrote: > > > On Wed, Feb 24, 2016 at 4:46 PM Kevin Gessner wrote: > >> On Tue, Feb 23, 2016 at 4:48 AM, Chris Riley wrote: >> >> > This isn't such a great idea as it will cause some of traits >> functionality >> > to be broken: I can currently use a tr

Re: [PHP-DEV] Fw: unpack()

2016-02-25 Thread Nikita Popov
On Thu, Feb 25, 2016 at 8:08 AM, Dmitry Stogov wrote: > > > > > From: Dmitry Stogov > Sent: Wednesday, February 24, 2016 13:35 > To: Hynek Bartoš; php-...@lists.php.net; php-general-h...@lists.php.net > Subject: Re: unpack() > > > Hi, > > > I think the requested f

Re: [PHP-DEV] unpack()

2016-02-25 Thread Rasmus Lerdorf
Trivial things like adding a completely non-controversial optional argument to a function really does not require an RFC. Let's not get hung up on process just for the sake of process here. -Rasmus

Re: [PHP-DEV] unpack()

2016-02-25 Thread Dmitry Stogov
unpack() already returned false in case of "incorrect" input string, Search for RETRUN_FALSE in its body. The test(s) should be added of course. From: Marco Pivetta Sent: Thursday, February 25, 2016 14:12 To: Dmitry Stogov Cc: Michael Wallner; internals@lists.ph

Re: [PHP-DEV] unpack()

2016-02-25 Thread Marco Pivetta
Another note: the return type of the function completely changed (may return `false` now) - also to be checked/documented/tested. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 25 February 2016 at 06:07, Dmitry Stogov wrote: > You are right about the error. Thanks fo

Re: [PHP-DEV] unpack()

2016-02-25 Thread Dmitry Stogov
You are right about the error. Thanks for checking. From: Michael Wallner on behalf of Michael Wallner Sent: Thursday, February 25, 2016 13:53 To: Dmitry Stogov Cc: internals@lists.php.net; Hynek Bartoš Subject: Re: [PHP-DEV] unpack() I think the requested fe

Re: [PHP-DEV] unpack()

2016-02-25 Thread Michael Wallner
> I think the requested feature may be really useful. > > And the implementation is really simple > https://gist.github.com/dstogov/edbb1efcd1e9701e75ab > There seems to be a typo at https://gist.github.com/dstogov/edbb1efcd1e9701e75ab#fi

Re: [PHP-DEV] Fw: unpack()

2016-02-25 Thread Dmitry Stogov
If RFC is required, could some volunteer take care about it. Thanks. Dmitry. From: Marco Pivetta Sent: Thursday, February 25, 2016 12:01 To: Dmitry Stogov Cc: PHP Internals List; Hynek Bartoš Subject: Re: [PHP-DEV] Fw: unpack() Hi Dmitry, Yes, this is an API

Re: [PHP-DEV] Fw: unpack()

2016-02-25 Thread Yasuo Ohgaki
Hi all, On Thu, Feb 25, 2016 at 5:12 PM, Pierre Joye wrote: > On Feb 25, 2016 2:08 PM, "Dmitry Stogov" wrote: >> >> >> >> >> >> From: Dmitry Stogov >> Sent: Wednesday, February 24, 2016 13:35 >> To: Hynek Bartoš; php-...@lists.php.net; php-general-h...@lists.php.

Re: [PHP-DEV] [RFC Proposal] var keyword deprecation/removal

2016-02-25 Thread Tony Marston
wrote in message news:56cdeb49.5040...@fleshgrinder.com... On 2/22/2016 9:12 PM, Stanislav Malyshev wrote: Hi! Hey there. :) On 2/22/2016 9:12 PM, Stanislav Malyshev wrote: Old cellphones were shipped with a user manual that contained precise instructions on how to deal with the installed O

Re: [PHP-DEV] Fw: unpack()

2016-02-25 Thread Marco Pivetta
Hi Dmitry, Yes, this is an API change, and therefore needs an RFC, even if it may look like an obvious/simple change. Functional tests for the new parameter are also needed. Cheers, Marco On Feb 25, 2016 02:08, "Dmitry Stogov" wrote: > > > > > From: Dmitry Sto

Re: [PHP-DEV] Fw: unpack()

2016-02-25 Thread Pierre Joye
On Feb 25, 2016 2:08 PM, "Dmitry Stogov" wrote: > > > > > > From: Dmitry Stogov > Sent: Wednesday, February 24, 2016 13:35 > To: Hynek Bartoš; php-...@lists.php.net; php-general-h...@lists.php.net > Subject: Re: unpack() > > > Hi, > > > I think the requested featur