Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34649 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26420 invoked by uid 1010); 10 Jan 2008 15:04:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 26405 invoked from network); 10 Jan 2008 15:04:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jan 2008 15:04:20 -0000 Authentication-Results: pb1.pair.com header.from=parasane@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=parasane@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.162.236 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: parasane@gmail.com X-Host-Fingerprint: 64.233.162.236 nz-out-0506.google.com Received: from [64.233.162.236] ([64.233.162.236:3649] helo=nz-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 87/68-59671-3F336874 for ; Thu, 10 Jan 2008 10:04:20 -0500 Received: by nz-out-0506.google.com with SMTP id x7so376530nzc.38 for ; Thu, 10 Jan 2008 07:04:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=CUNyQ5iTABsnd+i+JpxXBiuiXG+5y6S4N/qM7bfzZE4=; b=K1w0DAbakEIOcksQZmtkV8xQwO8htljdKr9hW97ml3QQdnMLF6TOvcuEH9lK80QOSJLOgyMsclJPqA+jGRTGlkVYadRHDUKNY9+bhJiar1d0ZpUoanFxPmyWnKTHEFQ8a6Qn2Yn9OmDHuimbe8kdVAv0QR0A/wJ0NCTFd0hVMgo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=XVaq9matQ4bJYA2bBmEmjrypkwJ2/ZwQSSKSdax/zqyIWK/ZrPk1vNna0omkHShkXx+3XBTthEzbnHRd7J1LTxcI+kWEeng6CBOSn/gG8subOo2xFJFNnHZhe0zOUF/ePhk0gL7O+MIgcGahmi1tqgpjBMNxjVTHHok2VPtydHw= Received: by 10.141.23.7 with SMTP id a7mr1273697rvj.5.1199977457203; Thu, 10 Jan 2008 07:04:17 -0800 (PST) Received: by 10.140.204.10 with HTTP; Thu, 10 Jan 2008 07:04:17 -0800 (PST) Message-ID: Date: Thu, 10 Jan 2008 10:04:17 -0500 To: "Sam Barrow" Cc: "Hannes Magnusson" , "Marcus Boerger" , "Ryusuke SEKIYAMA" , internals@lists.php.net, "Stanislav Malyshev" In-Reply-To: <1199975968.25972.7.camel@sbarrow-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1665325616.20080110111902@marcus-boerger.de> <7f3ed2c30801100556y14b27d5es24eb8865b9f330e2@mail.gmail.com> <1199975968.25972.7.camel@sbarrow-desktop> Subject: Re: [PHP-DEV] [RFC] Square brackets shortcut From: parasane@gmail.com ("Daniel Brown") On Jan 10, 2008 9:39 AM, Sam Barrow 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 safe 5 key strokes) is obvious to users? > > > > Noone would confuse this with named arguments? > > Why can't I do function foo([] $array) {} ? > > > > foo([]); > > $var = []; > > Is this really readable? > > > > Are you really serious about this? > > I don't think the only benefit in this would be to save keystrokes. I > think it looks better, and makes code more readable, whereas the current > way just looks like a function call. Not only do I agree, but I'll also refer anyone wondering how well it would really be adopted due to the initial difficulty in recognizing the structure to the ternary operator. Unless it's an obvious condition and result, ternary operation itself is equally - if not more - trivial to initially figure out than $a = [1,2,3];. -- Daniel P. Brown Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since 1979.