+1
I hope this didn't die; As a developer, I really like to use this
syntax, and find it preferably from working with javascript, ruby,
python, etc.
Regards,
Eric
On Jan 21, 2008, at 12:36 AM, taylor luk wrote:
+1
firstly, square brackets are natural short cut to array(...) that
you c
+1
firstly, square brackets are natural short cut to array(...) that you can
find in many many language, one may argue this is merely a minor addition.
however, PHP is already a very verbose compare to other language, syntactic
improvements adds up it allows us to create much more readable code.
Antony Dovgal wrote:
> On 10.01.2008 13:07, Ryusuke SEKIYAMA wrote:
>> Hello, lists,
>>
>> I'm tired to type "array()" many times.
>
> -1
>
> The parser in my head is unable to parse this:
> $var=["str"];
> $var["str"]=1;
> ?>
>
Eh, that would just come out as
[ 0 => "str",
"str" => 1 ]
No
a) Commit square bracket array shortcut patch
keys and values are separated by colons.
( http://www.opendogs.org/pub/php-5.3dev-080109-sbar.patch )
e.g.
$a = [1, 2, 3];
$b = ['foo': 'orange', 'bar': 'apple', 'baz': 'lemon'];
Breaks from PHP's => for no apparent reason (one charact
On 11 Jan 2008, at 14:28, Mark Dennehy wrote:
b) Commit square bracket array shortcut patch
keys and values are separated by double arrows.
Breaks backwards compatibility to save typing five characters. See
above. -1.
It doesn't break backwards compatibility; the new syntax is an
alias,
On Jan 11, 2008 2:17 PM, Geoffrey Sneddon <[EMAIL PROTECTED]> wrote:
> I don't think tiredness to type an extra five characters should be an
> excuse to change the syntax.
No, but clarity of expression is a valid reason to do so.
> > a) Commit square bracket array shortcut patch
> >keys an
On 10 Jan 2008, at 10:07, Ryusuke SEKIYAMA wrote:
I'm tired to type "array()" many times. And I want to
declare arrays more easily. So I wrote the patch for
zend_language_parser.y which enables to declare arrays
with square brackets like some other languages.
I don't think tiredness to type a
> > -Original Message-
> > From: Ryusuke SEKIYAMA [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, January 10, 2008 2:08 AM
> > To: internals@lists.php.net
> > Cc: Marcus Boerger; Stas Malyshev
> > Subject: [PHP-DEV] [RFC] Square brackets shortcut
> >
On 10.01.2008 13:07, Ryusuke SEKIYAMA wrote:
> Hello, lists,
>
> I'm tired to type "array()" many times.
-1
The parser in my head is unable to parse this:
--
Wbr,
Antony Dovgal
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Hi, I hope this is the appropriate list. I have been banging on this issue
for quite some time. Basically, I have an intermittent problem with
various stream calls.
Essentially, I see massive CPU utilization while waiting to get data from
some http locations, under some circumstances.
This is
> The [] array literal syntax is also used by Javascript, and there's even an
> object literal syntax, {}, which is quite nice. Does that mean "Javascript
> is classic Perl"?
Yes, the first thing that comes to mind from this syntax is Perl.
(1, 2, 3, 4, 5)
("dharma", "wilma", "greg", "mina")
qw{
On Thursday 10 January 2008, Tomi Kaistila wrote:
> Well if confusing is the goal, then yes, since this is classic Perl.
>
> I started using PHP, instead of Perl, just so that I would not need play
> around with confusing syntax.
>
> Tomi Kaistila
> PHP Developer
The [] array literal syntax is als
a different thread :)
>
> Andi
>
>
> > -Original Message-
> > From: Hannes Magnusson [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, January 10, 2008 6:49 AM
> > To: Sam Barrow
> > Cc: PHP Development
> > Subject: Re: [PHP-DEV] [RFC] Square brackets sh
On Thu, 10 Jan 2008, Hannes Magnusson wrote:
> So you reject scalar type hinting because it isn't type casting and
> can therefor confuses newbies - but scattering seemingly random
> brackets around your code (to safe 5 key strokes) is obvious to users?
>
> Noone would confuse this with named arg
Hi,
On Jan 10, 2008 11:07 AM, Ryusuke SEKIYAMA <[EMAIL PROTECTED]> wrote:
> b) Commit square bracket array shortcut patch
> keys and values are separated by double arrows.
> ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar2.patch )
> e.g.
> $a = [1, 2, 3];
> $b = ['foo' =
ilto:[EMAIL PROTECTED]
> Sent: Thursday, January 10, 2008 6:49 AM
> To: Sam Barrow
> Cc: PHP Development
> Subject: Re: [PHP-DEV] [RFC] Square brackets shortcut
>
> Did you know that you don't have to reply multiple times to the same
> post?
> And even though Stas replies t
I recommended (b) a few months back and got shot down :)
I still like it :)
Andi
> -Original Message-
> From: Ryusuke SEKIYAMA [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 10, 2008 2:08 AM
> To: internals@lists.php.net
> Cc: Marcus Boerger; Stas Malyshev
> Subje
On Jan 10, 2008 9:39 AM, Sam Barrow <[EMAIL PROTECTED]> wrote:
> On Thu, 2008-01-10 at 14:56 +0100, Hannes Magnusson wrote:
> > So you reject scalar type hinting because it isn't type casting and
> > can therefor confuses newbies - but scattering seemingly random
> > brackets around your code (to s
Did you know that you don't have to reply multiple times to the same post?
And even though Stas replies to every single post, you don't have to do it too.
Please read Andis "checklist" again;
http://news.php.net/php.internals/34494 - same "rules" apply to all
threads.
-Hannes
On Jan 10, 2008 3:
On Thu, 2008-01-10 at 14:56 +0100, Hannes Magnusson wrote:
> So you reject scalar type hinting because it isn't type casting and
> can therefor confuses newbies - but scattering seemingly random
> brackets around your code (to safe 5 key strokes) is obvious to users?
>
> Noone would confuse this w
I just tried this out using option b, and I really like it.
$var = [1, 6, 434] ;
I think it looks good and helps code readability alot.
On Thu, 2008-01-10 at 19:07 +0900, Ryusuke SEKIYAMA wrote:
> Hello, lists,
>
> I'm tired to type "array()" many times. And I want to
> declare arrays more easi
On Thu, 2008-01-10 at 16:18 +0200, Giedrius D wrote:
> Hi,
>
> On Jan 10, 2008 3:56 PM, Hannes Magnusson <[EMAIL PROTECTED]> wrote:
> > So you reject scalar type hinting because it isn't type casting and
> > can therefor confuses newbies - but scattering seemingly random
> > brackets around your c
On Jan 10, 2008, at 3:12 PM, Tomi Kaistila wrote:
Well if confusing is the goal, then yes, since this is classic Perl.
I started using PHP, instead of Perl, just so that I would not need
play
around with confusing syntax.
Right, PHP was always about making it easy to see whats going on an
I like b.
On Thu, 2008-01-10 at 19:07 +0900, Ryusuke SEKIYAMA wrote:
> Hello, lists,
>
> I'm tired to type "array()" many times. And I want to
> declare arrays more easily. So I wrote the patch for
> zend_language_parser.y which enables to declare arrays
> with square brackets like some other lan
Hi,
On Jan 10, 2008 3:56 PM, Hannes Magnusson <[EMAIL PROTECTED]> wrote:
> So you reject scalar type hinting because it isn't type casting and
> can therefor confuses newbies - but scattering seemingly random
> brackets around your code (to safe 5 key strokes) is obvious to users?
>
> Noone would
Well if confusing is the goal, then yes, since this is classic Perl.
I started using PHP, instead of Perl, just so that I would not need play
around with confusing syntax.
Tomi Kaistila
PHP Developer
On Thursday 10 January 2008 15:56:54 Hannes Magnusson wrote:
> So you reject scalar type hintin
So you reject scalar type hinting because it isn't type casting and
can therefor confuses newbies - but scattering seemingly random
brackets around your code (to safe 5 key strokes) is obvious to users?
Noone would confuse this with named arguments?
Why can't I do function foo([] $array) {} ?
foo
If we are going to implement this, I think we should use the (b) syntax
since its how you define array elements today
On Jan 10, 2008 8:19 AM, Marcus Boerger <[EMAIL PROTECTED]> wrote:
> Hello Ryusuke,
>
> I like b) !
>
> marcus
>
> Thursday, January 10, 2008, 11:07:36 AM, you wrote:
>
> > Hello
Hello Ryusuke,
I like b) !
marcus
Thursday, January 10, 2008, 11:07:36 AM, you wrote:
> Hello, lists,
> I'm tired to type "array()" many times. And I want to
> declare arrays more easily. So I wrote the patch for
> zend_language_parser.y which enables to declare arrays
> with square brackets
Hello, lists,
I'm tired to type "array()" many times. And I want to
declare arrays more easily. So I wrote the patch for
zend_language_parser.y which enables to declare arrays
with square brackets like some other languages.
Stanislav,
Sorry, I'm new in this list and I didn't know about past
discu
30 matches
Mail list logo