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

2012-08-17 Thread Alexey Zakhlestin
On 16.08.2012, at 0:18, Rasmus Schultz wrote: > How come there is no straight-foward obvious way to simply remove a given > value from an array? Well, this sounds like a reason for creating SplSet class -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www

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

2012-08-17 Thread Sherif Ramadan
On Thu, Aug 16, 2012 at 2:39 AM, Lars Schultz wrote: > Am 16.08.2012 07:55, schrieb Sherif Ramadan: > >> Now your array is something completely different from what you wanted. >> The solution stated earlier is the most sane one (just using >> array_keys() with a search value). > > > the array_keys

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

2012-08-17 Thread Laruence
Hi: This feature introduces list() support in foreach constructs(more info can be found here: https://wiki.php.net/rfc/foreachlist). this could make the grammar more consistent, see following example: previous discussion could be found at : http://marc.info/?l=php-internals&m=134277

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

2012-08-17 Thread Tjerk Meesters
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 operators the short > ternary operator should be usable in conjunction with t

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

2012-08-17 Thread Ángel González
On 17/08/12 23:41, 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 > operators the short ternary operator should be usable in conjunction > with the assignment like the other binary

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

2012-08-17 Thread Nikita Popov
On Fri, Aug 17, 2012 at 11:35 PM, Rasmus Schultz wrote: > Most other languages have more than one collection-type... since PHP has > only the single, hybrid array-type which acts both as a hash and as an > array, something like this ought to be available. > > I don't know why everyone is so eager

[PHP-DEV] Combined assignment operator for short ternary

2012-08-17 Thread Sebastian Krebs
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 operators the short ternary operator should be usable in conjunction with the assignment like the other binary operators. Don't know, if anybody understands me

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

2012-08-17 Thread Rasmus Lerdorf
On 08/17/2012 05:35 PM, Rasmus Schultz wrote: > Most other languages have more than one collection-type... since PHP has > only the single, hybrid array-type which acts both as a hash and as an > array, something like this ought to be available. > > I don't know why everyone is so eager to jump up

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

2012-08-17 Thread Rasmus Schultz
Most other languages have more than one collection-type... since PHP has only the single, hybrid array-type which acts both as a hash and as an array, something like this ought to be available. I don't know why everyone is so eager to jump up and argue against something this simple, basic and usef

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

2012-08-17 Thread 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've got a function-call, an intermediar

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

2012-08-17 Thread Rasmus Schultz
> > 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've got a function-call, an intermediary variable, a boolean test, and an unset statement repeatin

Re: [PHP-DEV] Inline typecasting / typehinting for classes and interfaces

2012-08-17 Thread André Rømcke
On Aug 15, 2012, at 8:33 PM, Nikita Popov wrote: On Wed, Aug 15, 2012 at 8:15 PM, Kris Craig mailto:kris.cr...@gmail.com>> wrote: On Wed, Aug 15, 2012 at 4:48 AM, Anthony Ferrara mailto:ircmax...@gmail.com>>wrote: Stan, On Wed, Aug 15, 2012 at 3:57 AM, Stan Vass mailto:sv_for...@fmethod.com>>

[PHP-DEV] Phar PGP signature support

2012-08-17 Thread Evan Coury
Hi all, I'm wondering what the status/plan is for supporting PGP for Phar signatures. So far I've only found a couple of vague references such as on the Phar::setSignatureAlgorithm() manual page: > The signature algorithm must be one of Phar::MD5, Phar::SHA1, Phar::SHA256, > Phar::SHA512, or Ph