Re: [PHP-DEV] Allow Iterator to be used with current, next, reset, key functions

2016-11-03 Thread David Lundgren
On 11/3/16 2:58 PM, Levi Morrison wrote: >> I think it would be bad to remove these functions and force users to >> wrap arrays with ArrayIterator, just to manually iterate an array. After >> spending a little time looking through how these functions are being >> used in frameworks and libraries, r

Re: [PHP-DEV] Allow Iterator to be used with current, next, reset, key functions

2016-11-03 Thread Levi Morrison
> I think it would be bad to remove these functions and force users to > wrap arrays with ArrayIterator, just to manually iterate an array. After > spending a little time looking through how these functions are being > used in frameworks and libraries, removing them seems like it will cause > more

Re: [PHP-DEV] Allow Iterator to be used with current, next, reset, key functions

2016-11-03 Thread David Lundgren
Thank you everyone for your feedback. Nikita's post about wrapping the array with an ArrayIterator provides the best approach to allow an array or Traversable to be used. This will also provide the greatest backwards compatible usage for those of us writing user code that would need to be compatib

RE: [PHP-DEV] Proposed RFC

2016-11-03 Thread Antony D'Andrea
Thanks everyone for your responses. It has not taken long to find situations where this idea starts to fall apart. For example, in the case of strpos, I would hope for the return value, but in other cases I would want the the original input if the output is not false. That makes this feature pr

[PHP-DEV] OpenSSL - New Defaults

2016-11-03 Thread Scott Arciszewski
Hi, Can we change openssl_public_encrypt() and openssl_private_decrypt() from defaulting to PKCS1v1.5 padding, in favor of defaulting to OAEP? I'll create an RFC for this later. It will just prevent a lot of issues. To wit: - https://framework.zend.com/security/advisory/ZF2015-10 - https://gith

Re: [PHP-DEV] Proposed RFC

2016-11-03 Thread David Rodrigues
> Yes I have but I would like it to return ($n1/$n2) or whatever this input is, > without repeating it again. But it should do exactly that, except for a falsy return (eg. zero, empty, null, false) - note INFINITY is a truth value, so 10/0, for instance, will return INF instead of "else value". F

Re: [PHP-DEV] Proposed RFC

2016-11-03 Thread Bishop Bettini
On Thu, Nov 3, 2016 at 11:02 AM, Antony D'Andrea < contac...@antonydandrea.com> wrote: > > I would like to propose a new feature that is as clean as this but is a > slightly different use case. This would require a new operator (up for > discussion, but an early idea is "?!") For example: > >

Re: [PHP-DEV] Proposed RFC

2016-11-03 Thread David Rodrigues
You have tried the ?: operator? echo !is_infinite($n1/$n2) ?: 0; It should returns true or 0, for this case. 2016-11-03 13:02 GMT-02:00 Antony D'Andrea : > Hi all, > > First off, this is my first time e-mailing internals or even thinking about > submitting RFC. Please forgive me if I fail t

[PHP-DEV] Proposed RFC

2016-11-03 Thread Antony D'Andrea
Hi all, First off, this is my first time e-mailing internals or even thinking about submitting RFC. Please forgive me if I fail to follow some kind of convention. In PHP 7.0, we were given the Null Coalesce operator. For example: echo $array['key']??"key is not set" would be the same as

[PHP-DEV] UGLY Benchmark Results for PHP Master 2016-11-03

2016-11-03 Thread lp_benchmark_robot
Results for project PHP master, build date 2016-11-03 06:25:16+02:00 commit: 624409b previous commit:c71ab72 revision date: 2016-11-02 12:12:25+08:00 environment:Haswell-EP cpu:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB

Re: [PHP-DEV] Algorithmic efficiency of zend_memrchr

2016-11-03 Thread Nikita Popov
On Thu, Nov 3, 2016 at 2:33 PM, Benjamin Coutu wrote: > The type qualifier is just copy paste relic. We'd of course have to remove > const form the signature (and the function body) for this to work. Quickly > looking at zend_memrchr's call sites I don't see that it would be a huge > issue to mod

Re: [PHP-DEV] Algorithmic efficiency of zend_memrchr

2016-11-03 Thread Benjamin Coutu
The type qualifier is just copy paste relic. We'd of course have to remove const form the signature (and the function body) for this to work. Quickly looking at zend_memrchr's call sites I don't see that it would be a huge issue to modify that or am I missing something? == Original ===

Re: [PHP-DEV] Algorithmic efficiency of zend_memrchr

2016-11-03 Thread Levi Morrison
On Thu, Nov 3, 2016 at 5:21 AM, Benjamin Coutu wrote: > Hello everyone, > > I think there are a few improvements that we could make to some fundamental > algorithms. > I'd like to point out one particular for now, to see if there is any interest > in these kind of low level code optimizations fr

[PHP-DEV] Algorithmic efficiency of zend_memrchr

2016-11-03 Thread Benjamin Coutu
Hello everyone, I think there are a few improvements that we could make to some fundamental algorithms. I'd like to point out one particular for now, to see if there is any interest in these kind of low level code optimizations from the community. Please consider the following code snippet extr

Re: [PHP-DEV] Security issue handling

2016-11-03 Thread Matteo Beccati
Hi, On 24/10/2016 07:16, Stanislav Malyshev wrote: > c. Get some specific people to volunteer to review patches in security > repo regularly - how? Any takers? I'd be happy to help with reviewing and also setting up a private C.I. to build and run the test suite regularly, if you think that's a g