Re: [PHP-DEV] Optimizing array_reverse for packed hash tables (when preserve_keys=false)

2016-07-27 Thread Xinchen Hui
Hey: On Wed, Jul 27, 2016 at 10:42 PM, Benjamin Coutu wrote: > Hello Xinchen, > > Analogue to the array_slice implementation, the array_reverse function > could also be optimized for packed hash tables when preserve_keys is false > (most common). > The following patch should do just that: > > if

Re: [PHP-DEV] [RFC] New operator for context-dependent escaping

2016-07-27 Thread Thomas Bley
> In many ways, defining a built-in function e($string, $context) would > fulfil most of the above. If things are so easy, why does so much code exist with XSS problems? Regards Thomas Rowan Collins wrote on 27.07.2016 22:57: > On 26/07/2016 14:15, Michael Vostrikov wrote: >> Ok. Just ask you,

Re: [PHP-DEV] automating gcov with third-party extensions

2016-07-27 Thread Sean DuBois
On Wed, Jul 27, 2016 at 05:22:24PM -0400, Adam Baratz wrote: > I had a positive experience using gcov with a C extension. I used it to get > a better sense of what the .phpt tests (and valgrind) were really telling > me. > > To get it to work in an automated way, I hacked out Makefile.gcov and some

[PHP-DEV] automating gcov with third-party extensions

2016-07-27 Thread Adam Baratz
I had a positive experience using gcov with a C extension. I used it to get a better sense of what the .phpt tests (and valgrind) were really telling me. To get it to work in an automated way, I hacked out Makefile.gcov and some relevant chunks of config.m4 from php-src. I'm wondering if there wou

Re: [PHP-DEV] [RFC] New operator for context-dependent escaping

2016-07-27 Thread Rowan Collins
On 26/07/2016 14:15, Michael Vostrikov wrote: Ok. Just ask you, why people ask the same question again since the time PHP was created? Why almost all feature requests mentioned in RFC are about an easy way to call htmlspecialchars()? You can vote up or down, I just want to get an official result

[PHP-DEV] Optimizing array_reverse for packed hash tables (when preserve_keys=false)

2016-07-27 Thread Benjamin Coutu
Hello Xinchen, Analogue to the array_slice implementation, the array_reverse function could also be optimized for packed hash tables when preserve_keys is false (most common). The following patch should do just that: if (!preserve_keys && (Z_ARRVAL_P(input)->u.flags & HASH_FLAG_PACKED)) {

Re: [PHP-DEV] RFC Karma Request

2016-07-27 Thread Christoph Becker
On 27.07.2016 at 13:53, Michał Brzuchalski: > 2016-07-27 12:24 GMT+02:00 Christoph Becker : > >> However, that still would require something like >> >> $str[0..mb_strlen($needle)-1] == $needle > > I've been working on range operator some time ago and had problem with > double-dot ".." as an op

[PHP-DEV] UGLY Benchmark Results for PHP Master 2016-07-27

2016-07-27 Thread lp_benchmark_robot
Results for project PHP master, build date 2016-07-27 06:27:31+03:00 commit: 687f983 previous commit:91f22a2 revision date: 2016-07-26 20:38:26-04: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] RFC Karma Request

2016-07-27 Thread Michał Brzuchalski
2016-07-27 12:24 GMT+02:00 Christoph Becker : > On 27.07.2016 at 02:55, Davey Shafik wrote: > > > Ah, I missed that. If we had ranges (e.g. $string[0..4] or > $string[-1..4]) > > that'd work, but we don't. > > However, that still would require something like > > $str[0..mb_strlen($needle)-1] ==

Re: [PHP-DEV] RFC Karma Request

2016-07-27 Thread Christoph Becker
On 27.07.2016 at 02:55, Davey Shafik wrote: > Ah, I missed that. If we had ranges (e.g. $string[0..4] or $string[-1..4]) > that'd work, but we don't. However, that still would require something like $str[0..mb_strlen($needle)-1] == $needle > Now I see some value in the function, though still

Re: [PHP-DEV] RFC Karma Request

2016-07-27 Thread Ferenc Kovacs
On Tue, Jul 26, 2016 at 8:41 PM, wrote: > Hello, > > I would like to submit an RFC for adding a str_begins and str_ends > function, in relation to https://bugs.php.net/bug.php?id=67035 and > https://bugs.php.net/bug.php?id=50434. I've added those functions on my > local PHP copy. I would like to

Re: [PHP-DEV] Request for rfc karma

2016-07-27 Thread Ferenc Kovacs
On Mon, Jul 25, 2016 at 9:57 PM, David Walker wrote: > Hi All, > > I'm desiring to propose my second RFC (thanks bishop for the intro) > regarding PR2031 . Seems there > has been a couple PR's attempting to raise a notice when accessing > non-array-like

Re: [PHP-DEV] Request for wiki karma

2016-07-27 Thread Ferenc Kovacs
On Wed, Jul 13, 2016 at 11:53 AM, Jesse Schalken wrote: > Hi internals, > > I'd like wiki karma to write an RFC for the feature of setting > properties/calling methods within an expression with the result of the > object itself, eg > > > $this->fooMethod(new FooParams() { > setBlah(BLAH_CONST