Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28207 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44855 invoked by uid 1010); 2 Mar 2007 20:26:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 44840 invoked from network); 2 Mar 2007 20:26:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Mar 2007 20:26:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.184.230 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 64.233.184.230 wr-out-0506.google.com Linux 2.4/2.6 Received: from [64.233.184.230] ([64.233.184.230:20888] helo=wr-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/F3-04700-36888E54 for ; Fri, 02 Mar 2007 15:26:12 -0500 Received: by wr-out-0506.google.com with SMTP id i31so511329wra for ; Fri, 02 Mar 2007 12:26:08 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; 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; b=Dg7ZEbTRiSockbynkI01qtV2V8yijit/Bf/oFsxwjtLtdK+AFRV4+EMkW47y7PoGEzFEjTwnTxEq8ckvvgJcSpOyXIyTXCwNb4Cl4UEdM8PkSJKBURICkolYGxT4TovV7D5rUQ1ykbX3NGq0p5DA8jmJ65EibT805G8k7KjDiTo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=CSfg0/yYpfT8mXKou1x6JRtqrcf9mF+GCd5vltySs7yZ+fhAk0hVGD05lM07OeihQ/94xK11wU5+NLqVxj78pV+6tveDCQGwxxDTpmrajX7kne4QynUA4z7ZSWL1vXwD4DYjUfIpEBb17GJHrm0aron0BFk+G6OQ4gWBtwtN11k= Received: by 10.115.92.2 with SMTP id u2mr373582wal.1172867167092; Fri, 02 Mar 2007 12:26:07 -0800 (PST) Received: by 10.114.181.10 with HTTP; Fri, 2 Mar 2007 12:26:07 -0800 (PST) Message-ID: Date: Fri, 2 Mar 2007 21:26:07 +0100 To: "Jakob Buchgraber" Cc: internals@lists.php.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4B.08.04700.2DB68E54@pb1.pair.com> <45E87EA0.8020602@gmail.com> Subject: Re: [PHP-DEV] Constant Parameters From: pierre.php@gmail.com (Pierre) On 3/2/07, Jakob Buchgraber wrote: > Marco Kaiser wrote: > > Hi Jakob, > >> It would be nice if in PHP 6 using constant parameters for functions > >> and methods would be possible. This feature is e.g. available in Java. > >> > >> function doSth (const A) { > >> if (defined ("A")) echo "A is a constant"; > >> } > >> > >> doSth ("foo"); > >> > >> Cheers, > >> Jay > >> > > This makes absolute no sense, why you want this? > > > > -- Marco > > It's just a way of ensuring that a parameter cannot be changed within a > method (e.g. an id). I am using this feature frequently in Java. It > actually got no "deeper" sense, but it's just a nice feature I'd like to > use in PHP too. :-) It actually comes from the C/C++ "const" like foo(const char *str). It makes very little sense to have it in PHP. --Pierre