Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20917 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93977 invoked by uid 1010); 30 Nov 2005 23:27:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 93961 invoked from network); 30 Nov 2005 23:27:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Nov 2005 23:27:00 -0000 X-Host-Fingerprint: 194.109.253.196 mediawave.xs4all.nl Received: from ([194.109.253.196:1901] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 2D/57-14828-3453E834 for ; Wed, 30 Nov 2005 18:27:00 -0500 Message-ID: <2D.57.14828.3453E834@pb1.pair.com> To: internals@lists.php.net Date: Thu, 01 Dec 2005 00:27:40 +0100 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 References: <374c2968dd7f3d13c696037ef850256f@gravitonic.com> In-Reply-To: <374c2968dd7f3d13c696037ef850256f@gravitonic.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 194.109.253.196 Subject: Re: [PHP-DEV] Named arguments revisited From: bart@mediawave.nl (Bart de Boer) Hi Jared, If probably don't understand named arguments correclty but couldn't you do something like: function(array('name1' => 'val1', 'name2' => $var)); In the function you could then check which keys (names) have values, thereby simulating a form of named agruments? > On Nov 29, 2005, at 11:17 PM, Jared White wrote: > >> Named arguments are absolutely essential for using PHP as a solid >> templating language, and, in fact, they also greatly enhance code >> readability for complex method calls of in-depth APIs. My experience >> with both Objective-C and Python has showed me the wonders and joys of >> named arguments, and it is something I've desperately wanted in PHP >> for ages. I'm sure I'm not alone in this. I've tried array constructs, >> multiple arguments with string-based names and fancy parsing using >> func_get_args(), and various combinations thereof, and nothing is a >> good substitute for the real deal.