|
Posted by jemptymethod on 10/28/07 13:18
On Oct 28, 8:53 am, jemptymethod <jemptymet...@gmail.com> wrote:
> I've created the following function for returning only ini keys that
> pertain to xdebug. I'm wondering how I might go about doing the same
> sort of thing with one or more of the various "array_" functions
> instead (e.g. array_filter). Since I'm working with xdebug (if you
> can't tell ;) I'll respond in kind with trace data comparing the
> functions
Interesting trace data already....by moving the calls to
strlen($xdebug_prefix) outside the loop, I reduce execution time from
over 15 milliseconds to under 10
> Thanks in advance....George Jempty
>
> function ini_get_xdebug() {
> $ini_all = ini_get_all();
> $ini_xdebug = array();
> $xdebug_prefix = 'xdebug.';
>
> foreach ($ini_all as $k=>$v) {
> if (substr($k, 0, strlen($xdebug_prefix)) == $xdebug_prefix) {
> $ini_xdebug[substr($k, strlen($xdebug_prefix))] = $v;
> }
> }
> return $ini_xdebug;
> }
Navigation:
[Reply to this message]
|