Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32329 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51508 invoked by uid 1010); 15 Sep 2007 11:45:23 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 51493 invoked from network); 15 Sep 2007 11:45:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Sep 2007 11:45:23 -0000 Authentication-Results: pb1.pair.com header.from=penguin@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=penguin@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 195.41.46.237 as permitted sender) X-PHP-List-Original-Sender: penguin@php.net X-Host-Fingerprint: 195.41.46.237 pfepc.post.tele.dk Linux 2.5 (sometimes 2.4) (4) Received: from [195.41.46.237] ([195.41.46.237:58197] helo=pfepc.post.tele.dk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/81-41823-1D5CBE64 for ; Sat, 15 Sep 2007 07:45:22 -0400 Received: from workpenguin (0x503e7549.bynxx18.adsl-dhcp.tele.dk [80.62.117.73]) by pfepc.post.tele.dk (Postfix) with SMTP id 187A78A0036; Sat, 15 Sep 2007 13:45:18 +0200 (CEST) To: nlopess@php.net ("Nuno Lopes") Cc: Date: Sat, 15 Sep 2007 13:45:12 +0200 Message-ID: References: <001f01c7f6f0$dbcf5350$4001a8c0@pc07653> In-Reply-To: <001f01c7f6f0$dbcf5350$4001a8c0@pc07653> X-Mailer: Forte Agent 1.91/32.564 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Re: RFC: mark functions as const for possible optimizations From: penguin@php.net (Peter Brodersen) On Fri, 14 Sep 2007 18:01:13 +0100, in php.internals nlopess@php.net ("Nuno Lopes") wrote: >My proposal is the following: >some functions when fed with constant arguments always return a constant= =20 >value, too. e.g.: >strlen('abcd') =3D=3D=3D 4. I like the general idea. Would there be some caveats with stuff like this if it is possible to change the charset at runtime? I guess it is important to be aware of whether a function is affected by different settings (and if these settings can be changed at runtime) to conclude if a function really is deterministic at this level. --=20 - Peter Brodersen