Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34692 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29916 invoked by uid 1010); 11 Jan 2008 10:54:33 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 29900 invoked from network); 11 Jan 2008 10:54:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jan 2008 10:54:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.163 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.163 mail4.netbeat.de Received: from [83.243.58.163] ([83.243.58.163:60628] helo=mail4.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C5/30-27385-7EA47874 for ; Fri, 11 Jan 2008 05:54:32 -0500 Received: (qmail 27402 invoked by uid 507); 11 Jan 2008 10:54:27 -0000 Received: from unknown (HELO ?192.168.1.102?) (postmaster%schlueters.de@82.135.75.41) by mail4.netbeat.de with ESMTPA; 11 Jan 2008 10:54:27 -0000 To: antonov@tessart.ru Cc: internals@lists.php.net In-Reply-To: <08.94.51656.F8937874@pb1.pair.com> References: <698DE66518E7CA45812BD18E807866CE011C7C7E@us-ex1.zend.net> <08.94.51656.F8937874@pb1.pair.com> Content-Type: text/plain Date: Fri, 11 Jan 2008 11:54:24 +0100 Message-ID: <1200048864.4755.9.camel@johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.12.2 (2.12.2-2.fc8) Content-Transfer-Encoding: 7bit Subject: Re: Array syntax [] From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, On Fri, 2008-01-11 at 12:40 +0300, Max Antonov wrote: > I use PHP since version 5.0 release > I'd like use this syntax > $a = [ 2,6,9 ]; > $b = ['a'=>1 , 'v'=>'string']; > foo(['bar'=>2, 'test'=null]); The last line is exactly why I won't like such a syntax. Just consider the a bit worse call like foo([1, $a[2]]); I might even construct worse examples, but in the end you'll have to take a quite close look to see what's going on, whereas the array() syntax directly tells you "hey, here's an array", it are just 5 letters, so typing it isn't too hard (especially when using an editor with completion) ... Yes, it's nice in short code, but I think it makes it way harder to read other people's code - and that's already hard enough. (I, myself, would, of course, ( ;-) ) use it "right" but I tend to read more code than I write) johannes