Re: [PHP-DEV] Let range() return a generator?

2017-03-17 Thread Sara Golemon
On Fri, Mar 17, 2017 at 9:10 PM, David Rodrigues wrote: > In this case, when you call range() inside a Generator() constructor, then > the range() (in C++) will acts differently, like a xrange(). > Doable: Yes. Fundamentally broken within PHP's engine design: Definitely. Calling scope should abso

Re: [PHP-DEV] Let range() return a generator?

2017-03-17 Thread David Rodrigues
Yeah, sorry, it was a bad example -- I just noted after I submit. hehe About "new Generator($arg)" I mean a method to flag the first argument on function, that should identify that it should work differently or default method (without allocate memory). I guess that it is not implemented on PHP cor

Re: [PHP-DEV] Let range() return a generator?

2017-03-17 Thread Sara Golemon
On Fri, Mar 17, 2017 at 8:40 PM, David Rodrigues wrote: > There are some way to PHP be flagged before run some function, and > understand that you wants to return a Generator instead of array? > For instance: new Generator(range(1, 1000)) makes range() work like a > generator instead of return an

Re: [PHP-DEV] Let range() return a generator?

2017-03-17 Thread David Rodrigues
There are some way to PHP be flagged before run some function, and understand that you wants to return a Generator instead of array? For instance: new Generator(range(1, 1000)) makes range() work like a generator instead of return an array - it's an alternative to avoid new keywords. Or, maybe, som

Re: [PHP-DEV] Let range() return a generator?

2017-03-17 Thread Sara Golemon
On Fri, Mar 17, 2017 at 10:46 AM, Sara Golemon wrote: > On Fri, Mar 17, 2017 at 1:40 AM, Niklas Keller wrote: >> Yes, that's a BC break. Instead of changing it, there could be a new >> function. But as it can be simply built in userland, I don't see much >> reason to have it in core. >> > 100% ag

[PHP-DEV] NEUTRAL Benchmark Results for PHP Master 2017-03-16

2017-03-17 Thread lp_benchmark_robot
Results for project PHP master, build date 2017-03-16 20:29:19-07:00 commit: 37da80b previous commit:6ad0a6f revision date: 2017-03-16 18:13:37+00: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] Let range() return a generator?

2017-03-17 Thread Sara Golemon
On Fri, Mar 17, 2017 at 1:40 AM, Niklas Keller wrote: > Yes, that's a BC break. Instead of changing it, there could be a new > function. But as it can be simply built in userland, I don't see much > reason to have it in core. > 100% agreed. This is a 3 line function and doing it in userland means

[PHP-DEV] PDO Sqlite functions – still experimental?

2017-03-17 Thread Christoph M. Becker
Hi! PDO::sqliteCreateAggregate(), sqliteCreateCollation() and ::sqliteCreateFunction() are marked as being experimental[1] since they've been introduced in PHP 5.1.0. Has that been overlooked, or are they really still experimental? [1]

[PHP-DEV] Re: [RFC] Extended String Types For PDO

2017-03-17 Thread Adam Baratz
> > Based on some pain points with my team and things I've heard from others, > I created an RFC to handle "national" character sets for emulated prepared > statements: > https://wiki.php.net/rfc/extended-string-types-for-pdo > The vote closed and this RFC was accepted. Thanks all for your feedbac

Re: [PHP-DEV] Let range() return a generator?

2017-03-17 Thread Adam Baratz
> Yes, that's a BC break. Instead of changing it, there could be a new > function. But as it can be simply built in userland, I don't see much > reason to have it in core. Whether or not it's in core, the two-pronged approach is what Python does (range and xrange). Sometimes you want an array and

Re: [PHP-DEV] Let range() return a generator?

2017-03-17 Thread David Rodrigues
I guess that a lot of PHP functions that could be replaced by a Generator (basically all array functions like array_values(), array_keys(), etc). But there are a big question: could it be applied to any case? It will be faster than just an array? Certainly it will be more memory optimized. About B