Re: Re: RFC: mark functions as const for possible optimizations

From: Date: Sun, 16 Sep 2007 19:02:19 +0000
Subject: Re: Re: RFC: mark functions as const for possible optimizations
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-32348@lists.php.net to get a copy of this message
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

« previous php.internals (#32348) next »