Re: [PHP-DEV] Implicit isset in ternary operator

2012-07-22 Thread Sanford Whiteman
> Use functions. I understood your post; I was replying to Yahav. Anyway, I don't agree with you that (built-in) functions are all we can add because there'll be too much debate. Other languages still consider adding operators over time and/or allow overloading. Getting functions added to the la

Re: [PHP-DEV] Implicit isset in ternary operator

2012-07-22 Thread Alex Aulbach
2012/7/23 Sanford Whiteman : >> I think that you can compare the situation to the short if syntax ($a > $b >> ? $c : $d) > > Not sure I understand... that *is* the situation under discussion, > no? Use functions. Above case for example: _greater($a, $b, $c, $d) where function _greater($a, $b, $

Re: [PHP-DEV] Implicit isset in ternary operator

2012-07-22 Thread Sanford Whiteman
> I think that you can compare the situation to the short if syntax ($a > $b > ? $c : $d) Not sure I understand... that *is* the situation under discussion, no? $a > $b ? ... and $a ? ... both use the ternary operator. You do raise (maybe on purpose, not totally clear what you were getting a

Re: [PHP-DEV] Make try/catch brackets optinal

2012-07-22 Thread Alex Aulbach
2012/7/20 Ivan Enderlin @ Hoa : > On 20/07/12 15:32, Alex Aulbach wrote: >> If you use try/catch that much, that you begin to think about the >> syntax, you have an architecture- or design-problem. > > Not sure about that. First, it was an example. Second, it happens more often > than you think. Fo

Re: [PHP-DEV] Implicit isset in ternary operator

2012-07-22 Thread Yahav Gindi Bar
On Mon, Jul 23, 2012 at 6:12 AM, Alex Aulbach wrote: > Do we really need that as operator? Why not using new functions for > special cases. > Don't see much difference between > > $a = $b ?: $c; > > and (for example I used "i" for "if") > > $a = _i($b, $c); > > Just a manner of getting accustomed

Re: [PHP-DEV] Implicit isset in ternary operator

2012-07-22 Thread Alex Aulbach
Do we really need that as operator? Why not using new functions for special cases. Don't see much difference between $a = $b ?: $c; and (for example I used "i" for "if") $a = _i($b, $c); Just a manner of getting accustomed to it. A little bit more thinking: This could be implemented directly i

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

2012-07-22 Thread Alex Aulbach
2012/7/20 Nikita Popov : > On Tue, Jun 5, 2012 at 7:35 PM, Nikita Popov > wrote: >> Hi internals! >> The implementation is outlined in the RFC-stub here: >> https://wiki.php.net/rfc/generators > > A small progress update on this: > * Generators are now automatically detected by the presence of "

Re: [PHP-DEV] [proposal + patch] array_pick() function

2012-07-22 Thread Ronald Chmara
Standard hazing: 1. Tests? 2. Docs? Annoying if needed whining: I think "array_pick" and "array_rand" are precisely the kind of function naming that makes PHP infamous. I would suggest that array_rand_key() and array_rand_value(), or array_rand() with an argument to default to key (for BC). Speed

[PHP-DEV] [proposal + patch] array_pick() function

2012-07-22 Thread Andrew Faulds
Hi there, This is a small function, called array_pick(), which takes one argument ($array), an array, and returns the value of a random item. Much of its usefulness stems from the new short array syntax, which lets you do array_pick(["funlogo.png", "coollogo.jpg", "kittens.gif"]);, instead of $a

Re: [PHP-DEV] Change of email address

2012-07-22 Thread Andrew Faulds
Don't worry, I unsubscribed on old account. It's forwarding. On 23 July 2012 at 00:49 Good Guy wrote: > On 22/07/2012 15:40, Andrew Faulds wrote: > > Hi there, > > > > My old email address was ajf...@googlemail.com, I am now using a...@ajf.me. > > > > I'm not sure I need to point this out, b

Re: [PHP-DEV] Change of email address

2012-07-22 Thread Good Guy
On 22/07/2012 15:40, Andrew Faulds wrote: Hi there, My old email address was ajf...@googlemail.com, I am now using a...@ajf.me. I'm not sure I need to point this out, but just in case it matters. Thanks. It matters only if you mind receiving duplicates of all postings on these newsgroup

[PHP-DEV] Re: [PHP-I18N] Unicode support with UString abstraction layer

2012-07-22 Thread Ferenc Kovacs
Hi, I think that there aren't that many people subscribed to this list, so I'm ccing the internals list, as your suggestion is to implement/bundle this to the core. On Wed, Mar 21, 2012 at 7:23 PM, Umberto Salsi wrote: > Although I never contributed to the code of the PHP project, I hope the >

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

2012-07-22 Thread Nikita Popov
On Sat, Jul 21, 2012 at 6:31 PM, Jared Williams wrote: > Can't yield a reference to an array item directly. > > Eg. > > function &map(array &$row) > { > yield $row[0]; > } Thanks, this is fixed now. > Also seems to be a problem with iterating > > foreach(map($row) as &$value) > > cannot be

Re: [PHP-DEV] common issue with version_compare()

2012-07-22 Thread Lester Caine
Kris Craig wrote: *raises his hand* 1.01 and 1.0.1 are essentially the same thing. If a versioning model doesn't utilize the second dot (many don't), then 1.01 would be the same as 1.0.1 in a project that does use it. The Gitflow model reserves that last digit for hotfixes. However, many deve