Rasmus | 1 Jun 01:01 2011

Re: [PHP-DEV] RFC: Zend Signal Handling

On 05/31/2011 03:35 PM, Stas Malyshev wrote:
> Hi!
> 
>> The patch is solid (have been using it in production for quite some
>> time) and improvement is quite helpful, especially when APC is being
>> used. Are there any reasons not to apply this to 5.4?
> 
> I don't know of any. Are there any issues with this change (BC, etc.)?

There could be some weird interactivity issues with certain
environments, but the patch takes care of most issues and I think the
added stability this gives opcode caches is worth the minor risk.

-Rasmus

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Michael Shadle | 1 Jun 01:30 2011
Picon

Re: [PHP-DEV] Re: RFC: Short syntax for Arrays (redux)

I've always considered json an awesome machine to machine interchange format (the most efficient one) but
not the easiest to read for configuration or manually defining anything.

I see nothing wrong with the initial example. Has worked well for years. :)

On May 31, 2011, at 3:43 PM, Marcel Esser <marcel.esser <at> croscon.com> wrote:

> From the perspective of someone that's just trying to get stuff done:
> 
> $packet = array('response' => array('status' => 1,'message' => ''),'data' => array('id' => 1,
'username' => 'john doe'));
> 
> $packet = ['response': ['status': 1, 'message': '', 'data': ['id': 1, 'username': 'john doe'] ] ];
> 
> The clarity improvement above is an exponential function that gets better and better the more deeply
nested you are. I don't know anyone that needs the ability to support full JSON notation in PHP, but there
are entirely too many deeply nested array() declarations with lots of tabs in our lives, especially when
we start working with things like JSON and/or Mongo or xyz.
> 
> That's all I wanted to say to this.
> 
> Cheers,
> M.
> 
> --
> Marcel Esser
> Vice President of Engineering, CROSCON
> +1 (202) 470-6090
> marcel.esser <at> croscon.com
> 
(Continue reading)

Marcel Esser | 1 Jun 01:39 2011

Re: [PHP-DEV] Re: RFC: Short syntax for Arrays (redux)

Yeah, you'll note I am not actually advocating making a full JSON
implementation in the PHP language.

However, as per your point, JSON is no longer just a machine interchange
format. It's many other things these days, including a query definition
protocol. It's unlikely that the number of systems that use JSON as a
descriptor or filter will decrease in the near future; many people are
implementing JSON subsets or supersets in this format. And, as mentioned,
that turns into a ton of typing when you start getting deeply nested - in
a way that is not nearly as straight-forward as functionally identical
JSON-like notation.

So, considering all that, there is no real reason that I can see why it
shouldn't be possible to facilitate the developer with an ability to more
easily express these more complicated, nested examples.

That's why everyone in Mexico was cheering.

- M.

--

-- 
Marcel Esser

Vice President of Engineering, CROSCON
+1 (202) 470-6090
marcel.esser <at> croscon.com

Before printing this e-mail, please consider the rainforest.

On 5/31/11 7:30 PM, "Michael Shadle" <mike503 <at> gmail.com> wrote:
(Continue reading)

Gwynne Raskind | 1 Jun 02:29 2011

Re: [PHP-DEV] RFC: Short syntax for Arrays (redux)

+1

On May 31, 2011, at 2:42 PM, Brian Moon wrote:

> https://wiki.php.net/rfc/shortsyntaxforarrays
> 
> Since this was brought again recently by Rasmus (http://markmail.org/message/fx3brcm4ekh645se) and
on Twitter where several people including Andi chimed in on it and Ilia seemed to reverse his thoughts as
well (with caveats), I thought I would start a real thread about it. The reason the RFC stalled was stated as:
> 
> "This patch will not be accepted because slight majority of the core developers voted against. Though if
you take a accumulated mean between core developers and userland votes seems to show the opposite it would
be irresponsible to submit a patch witch is not supported or maintained in the long run."
> 
> So, the PHP users want it, but too many PHP core devs did not want it or did not see the use of it. From rereading
the mailing list archive, most had the tone of "I don't see a reason for it." I was in that camp in 2003 when it
first came up. However, with the emergence of JSON and systems that use JSON as an interface, this type of
syntax would be most welcome in the day to day life of a PHP developer.
> 
> I would prefer (as Rasmus pointed out) not to start a long discussion about it. Primarily I would be curious
if anyone on the lists (from the RFC wiki page) below would like to change your vote or if you are not listed
below and would like to be counted, that would be great too.
> 
> PHP SVN account holder voters
> =============================
> Pro: Andrei Zmievski, Andi Gutmans, Pierre Joye, Rasmus Lerdorf, Stanislav Malyshev, Brian Moon, Kalle
Sommer Nielsen, Edin Kadribasic
> 
> Contra: Antony Dovgal, Derick Rethans, Jani Taskinen, Lokrain, Felipe Pena, Lukas Kahwe Smith, Marcus
Boerger, David Soria Parra, Johannes Schl├╝ter, Maciek Sokolewicz, Philip Olson, Ilia Alshanetsky,
(Continue reading)

Dan Birken | 1 Jun 02:29 2011
Picon

Re: [PHP-DEV] Re: RFC: Short syntax for Arrays (redux)

+1

To be honest, ['a': 'b'] or ['a' => 'b'] is so much better than array('a' =>
'b') for general use I don't even care which one is picked, as long as one
of them is picked.

-Dan

On Tue, May 31, 2011 at 3:43 PM, Marcel Esser <marcel.esser <at> croscon.com>wrote:

> From the perspective of someone that's just trying to get stuff done:
>
> $packet = array('response' => array('status' => 1,'message' => ''),'data'
> => array('id' => 1, 'username' => 'john doe'));
>
> $packet = ['response': ['status': 1, 'message': '', 'data': ['id': 1,
> 'username': 'john doe'] ] ];
>
> The clarity improvement above is an exponential function that gets better
> and better the more deeply nested you are. I don't know anyone that needs
> the ability to support full JSON notation in PHP, but there are entirely too
> many deeply nested array() declarations with lots of tabs in our lives,
> especially when we start working with things like JSON and/or Mongo or xyz.
>
> That's all I wanted to say to this.
>
> Cheers,
> M.
>
> --
(Continue reading)

dukeofgaming | 1 Jun 02:42 2011
Picon

Re: [PHP-DEV] Re: RFC: Short syntax for Arrays (redux)

On Tue, May 31, 2011 at 7:29 PM, Dan Birken <birken <at> gmail.com> wrote:

> +1
>
> To be honest, ['a': 'b'] or ['a' => 'b'] is so much better than array('a'
> =>
> 'b') for general use I don't even care which one is picked, as long as one
> of them is picked.
>
> -Dan
>

+1 to that too. Even when I've never liked that much "=>" and would love to
see ":" make an entrance instead .

I'm afraid that if ":" is associated with the JSON interop argument and the
later is discarded then ":" will be discarded too, much like what happened
with the echo shortcut ("<?=") and the short tags ("<?"). Perhaps the idea
of JSON interop could be taken to another RFC and get less noise and better
ideas as a separate topic.

Regards,

David
Etienne Kneuss | 1 Jun 02:57 2011
Picon
Picon

Re: [PHP-DEV] Re: RFC: Short syntax for Arrays (redux)

+1 for a short array syntax.

But only if you keep it consistent, PHP has always been using => for
key/val association, I don't see any reason to suddenly provide "key":
"val", unless what you want is to confuse people.

On Wed, Jun 1, 2011 at 02:42, dukeofgaming <dukeofgaming <at> gmail.com> wrote:
> On Tue, May 31, 2011 at 7:29 PM, Dan Birken <birken <at> gmail.com> wrote:
>
>> +1
>>
>> To be honest, ['a': 'b'] or ['a' => 'b'] is so much better than array('a'
>> =>
>> 'b') for general use I don't even care which one is picked, as long as one
>> of them is picked.
>>
>> -Dan
>>
>
> +1 to that too. Even when I've never liked that much "=>" and would love to
> see ":" make an entrance instead .
>
> I'm afraid that if ":" is associated with the JSON interop argument and the
> later is discarded then ":" will be discarded too, much like what happened
> with the echo shortcut ("<?=") and the short tags ("<?"). Perhaps the idea
> of JSON interop could be taken to another RFC and get less noise and better
> ideas as a separate topic.
>
> Regards,
>
(Continue reading)

Rasmus | 1 Jun 04:27 2011

Re: [PHP-DEV] Re: RFC: Short syntax for Arrays (redux)

On 05/31/2011 05:42 PM, dukeofgaming wrote:

> I'm afraid that if ":" is associated with the JSON interop argument and the
> later is discarded then ":" will be discarded too, much like what happened
> with the echo shortcut ("<?=") and the short tags ("<?"). Perhaps the idea
> of JSON interop could be taken to another RFC and get less noise and better
> ideas as a separate topic.

<?= has been decoupled from short tags in 5.4 and is always available.

-Rasmus

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Adam Harvey | 1 Jun 04:39 2011
Picon
Picon

Re: [PHP-DEV] Re: RFC: Short syntax for Arrays (redux)

On 1 June 2011 08:57, Etienne Kneuss <colder <at> php.net> wrote:
> +1 for a short array syntax.
>
> But only if you keep it consistent, PHP has always been using => for
> key/val association, I don't see any reason to suddenly provide "key":
> "val", unless what you want is to confuse people.

Agreed here: +1 for short array syntax using =>; -0 for short array
syntax using colons. PHP isn't JSON, and I'd rather be consistent with
previous PHP syntax, given the choice.

Adam

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

dukeofgaming | 1 Jun 04:49 2011
Picon

Re: [PHP-DEV] Re: RFC: Short syntax for Arrays (redux)

On Tue, May 31, 2011 at 9:27 PM, Rasmus <rasmus <at> lerdorf.com> wrote:

> On 05/31/2011 05:42 PM, dukeofgaming wrote:
>
> > I'm afraid that if ":" is associated with the JSON interop argument and
> the
> > later is discarded then ":" will be discarded too, much like what
> happened
> > with the echo shortcut ("<?=") and the short tags ("<?"). Perhaps the
> idea
> > of JSON interop could be taken to another RFC and get less noise and
> better
> > ideas as a separate topic.
>
> <?= has been decoupled from short tags in 5.4 and is always available.
>
> -Rasmus
>

Yep, I know, and thank you very much for that (I did see your commit a
couple of hours after you posted it). I think there was a lot of confusion
and fear (myself included) when "<?" were deprecated, e.g. the Kohana
project used to have them and recommend them too, but they removed the
practice later and stopped recommending them.

Anyhow, I think ":" vs "=>" is the only thing left to decide on this
proposal. I was thinking that if ":" was to be introduced, perhaps
"array('a':'A',...)" should also be added for consistency, and that is extra
work. In my opinion adopting ":" would be nice, but it would also be noise
for the developer community, perhaps good noise but noise nonetheless.
(Continue reading)


Gmane