Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39358 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68923 invoked from network); 26 Jul 2008 20:50:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jul 2008 20:50:28 -0000 Authentication-Results: pb1.pair.com header.from=david.zuelke@bitextender.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=david.zuelke@bitextender.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain bitextender.com does not designate 80.237.132.12 as permitted sender) X-PHP-List-Original-Sender: david.zuelke@bitextender.com X-Host-Fingerprint: 80.237.132.12 wp005.webpack.hosteurope.de Received: from [80.237.132.12] ([80.237.132.12:50690] helo=wp005.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BE/00-02589-31E8B884 for ; Sat, 26 Jul 2008 16:50:28 -0400 Received: from munich.bitxtender.net ([85.183.90.3] helo=[10.224.251.2]); authenticated by wp005.webpack.hosteurope.de running ExIM using esmtpsa (TLSv1:RC4-SHA:128) id 1KMqie-0002uv-SJ; Sat, 26 Jul 2008 22:50:24 +0200 Cc: "Rodrigo Saboya" , internals@lists.php.net Message-ID: <7E5FAAED-D7C2-44F6-B72D-EBDFBBDA00D7@bitextender.com> To: RQuadling@GoogleMail.com In-Reply-To: <10845a340807220737v47c7ed5dm37d272007ff33521@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v926) Date: Sat, 26 Jul 2008 22:50:24 +0200 References: <10845a340807220737v47c7ed5dm37d272007ff33521@mail.gmail.com> X-Mailer: Apple Mail (2.926) X-bounce-key: webpack.hosteurope.de;david.zuelke@bitextender.com;1217105428;1708a39a; Subject: Re: [PHP-DEV] Modify language grammar to allow commas to skip defaulted parameters. From: david.zuelke@bitextender.com (=?ISO-8859-1?Q?David_Z=FClke?=) Am 22.07.2008 um 16:37 schrieb Richard Quadling: > Actually, would allowing PHP to skip defaulted parameters be a better > facility to add? > > function foo($opt1 = Null, $opt2 = Null){} > > foo(,True); > > Hmm. Doesn't look good does it. But, useful. Having to supply the > default > value if you don't want to override the default is sort of > counter-intuitive. Suppling nothing should equal the default value. That would be totally brilliant, since it means that one wouldn't have to know the default value in order to skip an argument. We looked into this a couple of months ago and the info I got from the engineer that dug into the code was that it would be relatively complicated to implement in the engine (we were considering a keyword back then, sth like foo(default, true);). But if it can be done... I'm all for it. It's definitely useful. David