Re: [PHP-DEV] RFC: mark functions as const for possible optimizations

2007-09-25 Thread Stanislav Malyshev
Just a thought, now dl() has been deprecated and disabled in SAPIs (except CLI,CGI,embed), would that mean extension_loaded() would become a optimizable function? In non-dl SAPIs probably yes, that would be the consequence. -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http

RE: [PHP-DEV] RFC: mark functions as const for possible optimizations

2007-09-25 Thread Jared Williams
Hi, Just a thought, now dl() has been deprecated and disabled in SAPIs (except CLI,CGI,embed), would that mean extension_loaded() would become a optimizable function? So something like include extension_loaded('gmp') ? 'GMPFoo.php' : 'PHPFoo.php'; Would be optimized to be more APC friendly?

Re: [PHP-DEV] RFC: mark functions as const for possible optimizations

2007-09-17 Thread Nuno Lopes
I had a quick question about this. When would strlen('abcd') be execuated? Say I had the code: $a = false; // This set by external input if ( $a ) $b = strlen('abcd'); Would the optimizer work out the length before the program starts to run? Or would the optimizer wait until it knows the strl

Re: [PHP-DEV] RFC: mark functions as const for possible optimizations

2007-09-17 Thread Andrew Brampton
From: "Nuno Lopes" <[EMAIL PROTECTED]> To: "PHPdev" Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> My proposal is the following: some functions when fed with constant arguments always return a constant value, too. e.g.: strlen('abcd') === 4. This means that an optimizer ca

Re: [PHP-DEV] RFC: mark functions as const for possible optimizations

2007-09-14 Thread Nuno Lopes
Nuno Lopes wrote: > My proposal is the following: > some functions when fed with constant arguments always return a constant > value, too. e.g.: > strlen('abcd') === 4. wouldn't that be called "deterministic" and not "const"? yeah, exactly. I was missing the correct wording. (btw, appart of b

Re: [PHP-DEV] RFC: mark functions as const for possible optimizations

2007-09-14 Thread Hartmut Holzgraefe
Nuno Lopes wrote: My proposal is the following: some functions when fed with constant arguments always return a constant value, too. e.g.: strlen('abcd') === 4. wouldn't that be called "deterministic" and not "const"? -- Hartmut Holzgraefe, Principal Support Engineer . Discover