Re: [PHP-DEV] [VOTE]Call for voting: support use list in foreach

2012-08-19 Thread Sherif Ramadan
On Sun, Aug 19, 2012 at 2:07 AM, Laruence wrote: > On Sat, Aug 18, 2012 at 5:48 PM, Nikita Popov wrote: >> On Sat, Aug 18, 2012 at 6:34 AM, Laruence wrote: >>> Hi: >>> This feature introduces list() support in foreach constructs(more >>> info can be found here: https://wiki.php.net/rfc/forea

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

2012-08-19 Thread Lars Schultz
Sorry for creating more "noise"... Am 18.08.2012 06:59, schrieb Sherif Ramadan: Further more, your assumption here that the result is incorrect (or improperly indexed) is completely baseless and moot. You are making a bold assumption that I both care about the keys and that I expect them to be n

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

2012-08-19 Thread Yasuo Ohgaki
2012/8/20 Andrew Faulds : > On 20/08/12 00:16, Yasuo Ohgaki wrote: >> >> 2012/8/20 Andrew Faulds : >>> >>> On 20/08/12 00:05, Yasuo Ohgaki wrote: 2012/8/20 Etienne Kneuss : > > On Sun, Aug 19, 2012 at 11:57 PM, Yasuo Ohgaki > wrote: >> >> 2012/8/18 Rasmus Lerdorf : >>

Re: [PHP-DEV] PHP Performance - 1’000’000 iterations

2012-08-19 Thread Kris Craig
It's also worth noting that a billion iterations is a lot in any language, not just PHP. Plus most browsers would probably blow-up in your face if you tried to send that much data. --Kris On Sun, Aug 19, 2012 at 8:41 AM, Raymond Irving wrote: > Many thanks for the feedback. > > __ > Raymond >

RE: [PHP-DEV] [RFC] Generators

2012-08-19 Thread Jared Williams
> -Original Message- > From: Stas Malyshev [mailto:smalys...@sugarcrm.com] > Sent: 20 August 2012 00:08 > To: Derick Rethans > Cc: Nikita Popov; PHP internals > Subject: Re: [PHP-DEV] [RFC] Generators > > Hi! > > > I am against this. This is even more magic in PHP. Is it > really tha

Re: [PHP-DEV] [RFC] Generators

2012-08-19 Thread Rasmus Lerdorf
On 08/19/2012 07:07 PM, Stas Malyshev wrote: > Hi! > >> I am against this. This is even more magic in PHP. Is it really that >> difficult to have to mark the function with a different keyword, such as >> "generator": > > You have a point here, but "public static final generator function > foo()

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

2012-08-19 Thread Andrew Faulds
On 20/08/12 00:16, Yasuo Ohgaki wrote: 2012/8/20 Andrew Faulds : On 20/08/12 00:05, Yasuo Ohgaki wrote: 2012/8/20 Etienne Kneuss : On Sun, Aug 19, 2012 at 11:57 PM, Yasuo Ohgaki wrote: 2012/8/18 Rasmus Lerdorf : On 08/17/2012 05:21 PM, Rasmus Schultz wrote: if(($key = array_search($del_val

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

2012-08-19 Thread Yasuo Ohgaki
2012/8/20 Andrew Faulds : > On 20/08/12 00:05, Yasuo Ohgaki wrote: >> >> 2012/8/20 Etienne Kneuss : >>> >>> On Sun, Aug 19, 2012 at 11:57 PM, Yasuo Ohgaki >>> wrote: 2012/8/18 Rasmus Lerdorf : > > On 08/17/2012 05:21 PM, Rasmus Schultz wrote: >>> >>> if(($key = array_sear

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

2012-08-19 Thread Andrew Faulds
On 20/08/12 00:05, Yasuo Ohgaki wrote: 2012/8/20 Etienne Kneuss : On Sun, Aug 19, 2012 at 11:57 PM, Yasuo Ohgaki wrote: 2012/8/18 Rasmus Lerdorf : On 08/17/2012 05:21 PM, Rasmus Schultz wrote: if(($key = array_search($del_val, $messages)) !== false) { unset($messages[$key]); } Nothing

Re: [PHP-DEV] [RFC] Generators

2012-08-19 Thread Stas Malyshev
Hi! > I am against this. This is even more magic in PHP. Is it really that > difficult to have to mark the function with a different keyword, such as > "generator": You have a point here, but "public static final generator function foo()" sounds a bit long-winded to me... Also, we'd have then t

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

2012-08-19 Thread Yasuo Ohgaki
2012/8/20 Etienne Kneuss : > On Sun, Aug 19, 2012 at 11:57 PM, Yasuo Ohgaki wrote: >> 2012/8/18 Rasmus Lerdorf : >>> On 08/17/2012 05:21 PM, Rasmus Schultz wrote: > > if(($key = array_search($del_val, $messages)) !== false) { > unset($messages[$key]); > } > > Nothing ho

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

2012-08-19 Thread Etienne Kneuss
On Sun, Aug 19, 2012 at 11:57 PM, Yasuo Ohgaki wrote: > 2012/8/18 Rasmus Lerdorf : >> On 08/17/2012 05:21 PM, Rasmus Schultz wrote: if(($key = array_search($del_val, $messages)) !== false) { unset($messages[$key]); } Nothing horrible here. >>> >>> I disagree

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

2012-08-19 Thread Yasuo Ohgaki
2012/8/18 Rasmus Lerdorf : > On 08/17/2012 05:21 PM, Rasmus Schultz wrote: >>> >>> if(($key = array_search($del_val, $messages)) !== false) { >>> unset($messages[$key]); >>> } >>> >>> Nothing horrible here. >>> >> >> I disagree - this is (or should be) a simple, atomic operation... >> yet, you'

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

2012-08-19 Thread Nikita Popov
On Sun, Aug 19, 2012 at 6:03 PM, Derick Rethans wrote: > On Sun, 19 Aug 2012, Nikita Popov wrote: > >> On Sun, Aug 19, 2012 at 6:28 AM, Stas Malyshev >> wrote: >> > >> >> For PHP we would need to have some similar behavior. PHP's current >> >> exception model is incompatible with GeneratorExitEx

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

2012-08-19 Thread Andrew Faulds
On 19/08/12 17:03, Derick Rethans wrote: On Sun, 19 Aug 2012, Nikita Popov wrote: On Sun, Aug 19, 2012 at 6:28 AM, Stas Malyshev wrote: For PHP we would need to have some similar behavior. PHP's current exception model is incompatible with GeneratorExitException (because PHP does not have Bas

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

2012-08-19 Thread Derick Rethans
On Sun, 19 Aug 2012, Nikita Popov wrote: > On Sun, Aug 19, 2012 at 6:28 AM, Stas Malyshev wrote: > > > >> For PHP we would need to have some similar behavior. PHP's current > >> exception model is incompatible with GeneratorExitException > >> (because PHP does not have BaseExceptions). So what

Re: [PHP-DEV] PHP Performance - 1’000’000 iterations

2012-08-19 Thread Raymond Irving
Many thanks for the feedback. __ Raymond On Sun, Aug 19, 2012 at 10:02 AM, Rasmus Lerdorf wrote: > On 08/19/2012 10:29 AM, Raymond Irving wrote: > > Hello, > > > > What could have cause PHP to start out so great but then slows to a > crawl? > > Could it be the GC? > > > > Number of iterations N

Re: [PHP-DEV] PHP Performance - 1’000’000 iterations

2012-08-19 Thread Rasmus Lerdorf
On 08/19/2012 10:29 AM, Raymond Irving wrote: > Hello, > > What could have cause PHP to start out so great but then slows to a crawl? > Could it be the GC? > > Number of iterations Node.js PHP > --- > 100 2.00

Re: [PHP-DEV] Combined assignment operator for short ternary

2012-08-19 Thread Sebastian Krebs
Am 19.08.2012 00:20, schrieb Andrew Faulds: On 18/08/12 03:36, Tjerk Meesters wrote: Sent from my iPhone On 18 Aug, 2012, at 5:41 AM, Sebastian Krebs wrote: Hi, Don't know, how complicated this is (and also someone (not me) must implement it, because I can't :X), but to be in sync with the

Re: [PHP-DEV] PHP Performance - 1’000’000 iterations

2012-08-19 Thread Anthony Ferrara
On Sun, Aug 19, 2012 at 10:29 AM, Raymond Irving wrote: > Hello, > > What could have cause PHP to start out so great but then slows to a crawl? > Could it be the GC? > > Number of iterations Node.js PHP > --- > 100

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

2012-08-19 Thread Nikita Popov
On Sun, Aug 19, 2012 at 6:28 AM, Stas Malyshev wrote: > Hi! > >> For PHP we would need to have some similar behavior. PHP's current >> exception model is incompatible with GeneratorExitException (because >> PHP does not have BaseExceptions). So what I'd probably do instead is >> monkeypatch a ZEND