Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32348 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79725 invoked by uid 1010); 16 Sep 2007 19:02:21 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 79710 invoked from network); 16 Sep 2007 19:02:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2007 19:02:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=nlopess@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=nlopess@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.55.154.22 as permitted sender) X-PHP-List-Original-Sender: nlopess@php.net X-Host-Fingerprint: 212.55.154.22 relay2.ptmail.sapo.pt Linux 2.4/2.6 Received: from [212.55.154.22] ([212.55.154.22:58978] helo=sapo.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/86-42628-BBD7DE64 for ; Sun, 16 Sep 2007 15:02:21 -0400 Received: (qmail 7608 invoked from network); 16 Sep 2007 19:02:16 -0000 Received: from unknown (HELO sapo.pt) (10.134.35.208) by relay2 with SMTP; 16 Sep 2007 19:02:16 -0000 Received: (qmail 25316 invoked from network); 16 Sep 2007 19:02:16 -0000 X-AntiVirus: PTMail-AV 0.3-0.91.1 X-Virus-Status: Clean (0.00544 seconds) Received: from unknown (HELO pc07653) (nunoplopes@sapo.pt@[85.240.49.197]) (envelope-sender ) by mta13 (qmail-ldap-1.03) with SMTP for ; 16 Sep 2007 19:02:16 -0000 Message-ID: <002201c7f894$1b236060$4001a8c0@pc07653> To: "Peter Brodersen" Cc: References: <001f01c7f6f0$dbcf5350$4001a8c0@pc07653> Date: Sun, 16 Sep 2007 20:02:19 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 Subject: Re: [PHP-DEV] Re: RFC: mark functions as const for possible optimizations From: nlopess@php.net ("Nuno Lopes") > >My proposal is the following: > >some functions when fed with constant arguments always return a constant > >value, too. e.g.: > >strlen('abcd') === 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. uhm, damn, right. strlen() wasn't a good example.. my bad, sorry :S Anyway, you got the idea :) Nuno