Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Lester Caine
Morgan L. Owens wrote: For the third one ... I'm still waiting for some clarification on how yield is SUPPOSED to work anyway? If you are using a 'generator' to return a sequence of data elements, then just what does happen between each call to the generator ... DOES the generator get called for

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Tjerk Anne Meesters
On Tue, Aug 21, 2012 at 10:31 AM, Rasmus Schultz wrote: > Thank you, but this isn't really anything like what I had in mind. > > What I had in mind is more like set-semantics for arrays, e.g. designed to > work with sets of distinct values/objects. > > Since I do not have permission to write on t

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Levi Morrison
On Mon, Aug 20, 2012 at 8:47 PM, Levi Morrison wrote: > On Mon, Aug 20, 2012 at 8:31 PM, Rasmus Schultz wrote: >> Thank you, but this isn't really anything like what I had in mind. >> >> What I had in mind is more like set-semantics for arrays, e.g. designed to >> work with sets of distinct value

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Levi Morrison
On Mon, Aug 20, 2012 at 8:31 PM, Rasmus Schultz wrote: > Thank you, but this isn't really anything like what I had in mind. > > What I had in mind is more like set-semantics for arrays, e.g. designed to > work with sets of distinct values/objects. > > Since I do not have permission to write on the

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Rasmus Schultz
Thank you, but this isn't really anything like what I had in mind. What I had in mind is more like set-semantics for arrays, e.g. designed to work with sets of distinct values/objects. Since I do not have permission to write on the wiki, I posted an initial draft here: https://gist.github.com/32

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Yasuo Ohgaki
Hi, 2012/8/21 Rasmus Schultz : > I have a login (mindplay) but I do not have permission to post or edit > anything on the wiki... I've created RFC for this https://wiki.php.net/rfc/array_delete Get wiki account and finish discussion. I may write patch for this with my spare time, but it may tak

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Rasmus Schultz
I have a login (mindplay) but I do not have permission to post or edit anything on the wiki... On Mon, Aug 20, 2012 at 8:01 PM, Will Fitch wrote: > Please let this die until someone is serious enough to come up with an > rfc. This has been nothing but counterproductive arguing. If someone feels

Re: Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Morgan L. Owens
On 2012-08-21 01:10, Lester Caine wrote: For the third one ... I'm still waiting for some clarification on how yield is SUPPOSED to work anyway? If you are using a 'generator' to return a sequence of data elements, then just what does happen between each call to the generator ... DOES the genera

Re: [PHP-DEV] shared mysqlnd extension ...

2012-08-20 Thread Rasmus Lerdorf
On 08/20/2012 08:12 PM, Lester Caine wrote: > Rasmus Lerdorf wrote: >> On 08/20/2012 06:51 PM, Lester Caine wrote: >>> >Ferenc Kovacs wrote: >>why is this an internals question? >>> >Because no one answered on general:( >>> >But since the core code base does not compile it seems internal to me

Re: [PHP-DEV] shared mysqlnd extension ...

2012-08-20 Thread Lester Caine
Rasmus Lerdorf wrote: On 08/20/2012 06:51 PM, Lester Caine wrote: >Ferenc Kovacs wrote: >>why is this an internals question? >Because no one answered on general:( >But since the core code base does not compile it seems internal to me >anyway. The bundled extensions are not designed to be buil

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Will Fitch
Please let this die until someone is serious enough to come up with an rfc. This has been nothing but counterproductive arguing. If someone feels strongly about it, write an rfc then we can discuss? On Aug 20, 2012 7:53 PM, "Yasuo Ohgaki" wrote: > Hi, > > 2012/8/21 Herman Radtke : > >>> May be we

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Yasuo Ohgaki
Hi, 2012/8/21 Herman Radtke : >>> May be we should have something like >> >> >> >> >> array_delete_if($array, function($v, $k=null) { if ($v == 300) return >> >> true; }) >> > >> > So array_filter? >> >> I'll use it or like for deleting, but the point of this thread is >> "intuitive function for d

Re: [PHP-DEV] shared mysqlnd extension ...

2012-08-20 Thread Rasmus Lerdorf
On 08/20/2012 06:51 PM, Lester Caine wrote: > Ferenc Kovacs wrote: >> why is this an internals question? > Because no one answered on general :( > But since the core code base does not compile it seems internal to me > anyway. The bundled extensions are not designed to be built standalone using ph

Re: [PHP-DEV] shared mysqlnd extension ...

2012-08-20 Thread Lester Caine
Ferenc Kovacs wrote: Having now got mysql running on the PHP5.4.3 machine, I'm trying to compile mysqlnd and mysqli as extensions to load and unload as required. php_mysqlnd_config.h no longer exists, but why is the config file named config9.m4 rather than config.m4? What do I ne

Re: [PHP-DEV] shared mysqlnd extension ...

2012-08-20 Thread Lester Caine
Andrey Hristov wrote: On 08/20/2012 11:52 PM, Lester Caine wrote: Having now got mysql running on the PHP5.4.3 machine, I'm trying to compile mysqlnd and mysqli as extensions to load and unload as required. php_mysqlnd_config.h no longer exists, but why is the config file named config9.m4 rathe

Re: [PHP-DEV] shared mysqlnd extension ...

2012-08-20 Thread Andrey Hristov
On 08/20/2012 11:52 PM, Lester Caine wrote: Having now got mysql running on the PHP5.4.3 machine, I'm trying to compile mysqlnd and mysqli as extensions to load and unload as required. php_mysqlnd_config.h no longer exists, but why is the config file named config9.m4 rather than config.m4? What

Re: [PHP-DEV] shared mysqlnd extension ...

2012-08-20 Thread Ferenc Kovacs
On Mon, Aug 20, 2012 at 11:52 PM, Lester Caine wrote: > Having now got mysql running on the PHP5.4.3 machine, I'm trying to > compile mysqlnd and mysqli as extensions to load and unload as required. > > php_mysqlnd_config.h no longer exists, but why is the config file named > config9.m4 rather th

Re: [PHP-DEV] Merging fix for quoted_printable_encode()

2012-08-20 Thread Lars Strojny
Hi everybody, patch + test merged to master and 5.4. I would really like to merge it to 5.3 as well but if others disagree I could live without it. With regards, Lars Am 20.08.2012 um 22:03 schrieb Lars Strojny : > Hi Stas, > > I would prefer it int 5.3 as well as it might break mailing syste

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Nikita Popov
On Mon, Aug 20, 2012 at 10:07 PM, Ángel González wrote: > On 20/08/12 15:12, Nikita Popov wrote: >>> You could not decorate it and rely instead on the presence of the yield >>> keyword, but parsers will thank knowing about it from the start rather >>> than realising at mid-parsing that the functio

[PHP-DEV] shared mysqlnd extension ...

2012-08-20 Thread Lester Caine
Having now got mysql running on the PHP5.4.3 machine, I'm trying to compile mysqlnd and mysqli as extensions to load and unload as required. php_mysqlnd_config.h no longer exists, but why is the config file named config9.m4 rather than config.m4? What do I need to get these two extensions to b

Re: [PHP-DEV] Official Userland Library (was: removing an item from an array)

2012-08-20 Thread Lester Caine
Lars Schultz wrote: Am 20.08.2012 19:43, schrieb Sebastian Krebs: What I don't understand is, why should every function goes directly into the core, if you can achieve exactly the same without core changes? This comment from Sebastian got me thinking. It's true. Every-someone has his own views

Re: [PHP-DEV] Official Userland Library (was: removing an item from an array)

2012-08-20 Thread Andrew Faulds
On 20/08/12 21:43, Lars Schultz wrote: Am 20.08.2012 19:43, schrieb Sebastian Krebs: What I don't understand is, why should every function goes directly into the core, if you can achieve exactly the same without core changes? This comment from Sebastian got me thinking. It's true. Every-someon

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Alex Aulbach
I think this doesn't bring anything further to talk about how to implement this in the parser. After reading the thread again, I would like to say that - either this should be implemented as currently defined - or it is implemented with the generator-keyword. But then it isn't a function anymore,

[PHP-DEV] Official Userland Library (was: removing an item from an array)

2012-08-20 Thread Lars Schultz
Am 20.08.2012 19:43, schrieb Sebastian Krebs: What I don't understand is, why should every function goes directly into the core, if you can achieve exactly the same without core changes? This comment from Sebastian got me thinking. It's true. Every-someone has his own views on what is absolute

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Andrew Faulds
On 18/08/12 13:21, Derick Rethans wrote: On Sat, 11 Aug 2012, Nikita Popov wrote: Hi internals! I think there already was a lot of discussion on the generators, so it's time to move to the next step. I'd like to vote on the feature in two weeks, so this the "announce[ment] on internals@, by th

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Ángel González
On 20/08/12 15:12, Nikita Popov wrote: >> You could not decorate it and rely instead on the presence of the yield >> keyword, but parsers will thank knowing about it from the start rather >> than realising at mid-parsing that the function is a completely >> different beast. > No, parsers don't care

Re: [PHP-DEV] Merging fix for quoted_printable_encode()

2012-08-20 Thread Lars Strojny
Hi Stas, I would prefer it int 5.3 as well as it might break mailing systems using quoted_printable_encode(). I’ll add the test from the comments as well. Am 20.08.2012 um 20:30 schrieb Stas Malyshev : > Yes. For 5.3, it does not look like a critical bug, so it shouldn't be > there. Also, the t

Re: [PHP-DEV] compile php as fpm

2012-08-20 Thread Rasmus Lerdorf
On 08/20/2012 03:47 PM, Adi Mutu wrote: > Hello, > > I'm trying to compile php 5.3 as php-fpm using the following configure command > > > ./configure --enable-debug --enable-maintainer-zts --enable-fpm > --enable-fastcgi > > and i get this > > " > Thank you for using PHP. > > Notice: Follow

[PHP-DEV] compile php as fpm

2012-08-20 Thread Adi Mutu
Hello, I'm trying to compile php 5.3 as php-fpm using the following configure command ./configure --enable-debug --enable-maintainer-zts --enable-fpm --enable-fastcgi and i get this  " Thank you for using PHP. Notice: Following unknown configure options were used: --enable-fastcgi " The

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Andrew Faulds
On 20/08/12 19:46, Stas Malyshev wrote: Hi! What would *actually* make sense here are return value typehints. E.g. one could have something like `public Iterator getIterator() { ... }`. And again we're back to inventing syntax to do what documentation should be doing. For the large part, but

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Stas Malyshev
Hi! > What would *actually* make sense here are return value typehints. E.g. > one could have something like `public Iterator getIterator() { ... }`. And again we're back to inventing syntax to do what documentation should be doing. -- Stanislav Malyshev, Software Architect SugarCRM: http://www

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Stas Malyshev
Hi! > generator function f() { > echo "Hello World"; > } even more interesting, $a = generator function() { echo "Hello World"; } or even: function foo() { return generator function() { echo "Hello World"; } } $a = foo(); -- Stanislav Malyshev, Softw

Re: [PHP-DEV] Merging fix for quoted_printable_encode()

2012-08-20 Thread Stas Malyshev
Hi! > Hi everybody, > > I would like to merge https://github.com/php/php-src/pull/120 in HEAD, 5_4 > and 5_3 to fix splitting of soft line breaks. Any concerns? Yes. For 5.3, it does not look like a critical bug, so it shouldn't be there. Also, the tests are still not there - so they should be

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Levi Morrison
Also, `array_splice` will remove the index while modifying the array in-place. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Andrew Faulds
On 20/08/12 19:05, Levi Morrison wrote: Some major points to consider for `array_delete`'s behavior: 1. Should items be compared with `==`, `===`, or custom comparison? If we use `==` or `===` we'd probably add `array_udelete` to allow a custom comparator. array_delete($array, $value, $all=fals

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Levi Morrison
Some major points to consider for `array_delete`'s behavior: 1. Should items be compared with `==`, `===`, or custom comparison? If we use `==` or `===` we'd probably add `array_udelete` to allow a custom comparator. 2. Should it stop when it encounters the first value that matches? If it does, s

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Andrew Faulds
On 20/08/12 18:43, Sebastian Krebs wrote: Am 20.08.2012 19:00, schrieb Andrew Faulds: On 20/08/12 17:47, Herman Radtke wrote: May be we should have something like array_delete_if($array, function($v, $k=null) { if ($v == 300) return true; }) So array_filter? I'll use it or like for deleting

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Sebastian Krebs
Am 20.08.2012 19:00, schrieb Andrew Faulds: On 20/08/12 17:47, Herman Radtke wrote: May be we should have something like array_delete_if($array, function($v, $k=null) { if ($v == 300) return true; }) So array_filter? I'll use it or like for deleting, but the point of this thread is "intuitiv

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Andrew Faulds
On 20/08/12 18:27, Levi Morrison wrote: You are basically asking to alias array_filter with "array_delete". That is a very slippery slope. I think array_filter is a very obvious choice to remove something from an array. The "filter" function/method is common in functional languages (and functiona

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Levi Morrison
> You are basically asking to alias array_filter with "array_delete". That is > a very slippery slope. I think array_filter is a very obvious choice > to remove something from an array. The "filter" function/method is common > in functional languages (and functional frameworks like Underscore). Th

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Andrew Faulds
On 20/08/12 18:11, Levi Morrison wrote: Adding array_delete would allow you to use it like a set more It's not a set and wasn't meant to be. If you want really bad set behavior, feel free to use an array as one. Arrays also aren't lists or associative arrays, strictly speaking. And there is a

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Levi Morrison
> Adding array_delete would allow you to use it like a set more It's not a set and wasn't meant to be. If you want really bad set behavior, feel free to use an array as one. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Andrew Faulds
On 20/08/12 17:47, Herman Radtke wrote: May be we should have something like array_delete_if($array, function($v, $k=null) { if ($v == 300) return true; }) So array_filter? I'll use it or like for deleting, but the point of this thread is "intuitive function for deleting element(s)" array_de

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Herman Radtke
>> May be we should have something like > >> > >> array_delete_if($array, function($v, $k=null) { if ($v == 300) return > true; }) > > > > So array_filter? > > I'll use it or like for deleting, but the point of this thread is > "intuitive function for deleting element(s)" > > array_delete($array,

Re: [PHP-DEV] re: removing an item from an array

2012-08-20 Thread Rasmus Schultz
Absolutely, you're right. I have a tendency to get dragged into those. I apologize. On Fri, Aug 17, 2012 at 5:50 PM, Nikita Popov wrote: > > Could we please stop these pseudo-arguments?

Re: [PHP-DEV] removing an item from an array

2012-08-20 Thread Rasmus Schultz
I think adding more collection-types is the intuitive reaction to this issue, but there's something to be said for the idea of having only a single collection-type - I think that's one PHP feature we should not give up. Not having to pick and choose (and compromise) to select the "right" collectio

[PHP-DEV] Merging fix for quoted_printable_encode()

2012-08-20 Thread Lars Strojny
Hi everybody, I would like to merge https://github.com/php/php-src/pull/120 in HEAD, 5_4 and 5_3 to fix splitting of soft line breaks. Any concerns? With regards, Lars -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Jared Williams
> -Original Message- > From: Nikita Popov [mailto:nikita@gmail.com] > Sent: 20 August 2012 14:12 > To: Ángel González > Cc: Rasmus Lerdorf; Stas Malyshev; Derick Rethans; PHP internals > Subject: Re: [PHP-DEV] [RFC] Generators > > On Mon, Aug 20, 2012 at 1:56 PM, Ángel González >

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Wietse Venema
Rasmus Lerdorf: > So how about something like this: > > generator function f() { > echo "Hello World"; > } > > generator function f() { > return 1; > } > > generator function f($arg) { > if(f!$arg) yield 1; > else if($arg<0) return 1; > else return; > } > > What does the generator key

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Yahav Gindi Bar
On Mon, Aug 20, 2012 at 3:48 PM, Rasmus Lerdorf wrote: > On 08/20/2012 07:56 AM, Ángel González wrote: > > On 20/08/12 02:01, Rasmus Lerdorf wrote: > >> I would still like to understand what this generator keyword would > >> actually do. I don't see how it would work. Would a function marked > >>

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Nikita Popov
On Mon, Aug 20, 2012 at 1:56 PM, Ángel González wrote: > On 20/08/12 02:01, Rasmus Lerdorf wrote: >> I would still like to understand what this generator keyword would >> actually do. I don't see how it would work. Would a function marked >> generator somehow not be allowed to return normally or t

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Lester Caine
Rasmus Lerdorf wrote: So how about something like this: generator function f() { echo "Hello World"; } generator function f() { return 1; } generator function f($arg) { if(f!$arg) yield 1; else if($arg<0) return 1; else return; } What does the generator keyword mean in each of

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Rasmus Lerdorf
On 08/20/2012 07:56 AM, Ángel González wrote: > On 20/08/12 02:01, Rasmus Lerdorf wrote: >> I would still like to understand what this generator keyword would >> actually do. I don't see how it would work. Would a function marked >> generator somehow not be allowed to return normally or to finish a

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Ángel González
On 20/08/12 02:01, Rasmus Lerdorf wrote: > I would still like to understand what this generator keyword would > actually do. I don't see how it would work. Would a function marked > generator somehow not be allowed to return normally or to finish and not > return anything? How could this be enforce

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Pierre Joye
hi Rasmus! On Mon, Aug 20, 2012 at 2:01 AM, Rasmus Lerdorf wrote: > I would still like to understand what this generator keyword would > actually do. I don't see how it would work. Would a function marked > generator somehow not be allowed to return normally or to finish and not > return anythin

[PHP-DEV] Re: Need Help in Yaf spreading

2012-08-20 Thread Laruence
CC to php-general. thanks On Mon, Aug 20, 2012 at 4:06 PM, Laruence wrote: > Hi: > Yaf (http://pecl.php.net/yaf) is a PHP MVC framework, which is > build as a PHP extension. > > It could be considered as the fastest PHP framework for > now(http://www.laruence.com/2011/12/02/2333.html),

[PHP-DEV] Need Help in Yaf spreading

2012-08-20 Thread Laruence
Hi: Yaf (http://pecl.php.net/yaf) is a PHP MVC framework, which is build as a PHP extension. It could be considered as the fastest PHP framework for now(http://www.laruence.com/2011/12/02/2333.html), and it has already been used in a lots of productions in baidu, sina. like weibo.com