[pmwiki-users] PmWiki-generated warnings

Patrick R. Michaud pmichaud at pobox.com
Fri Jul 1 21:54:19 CDT 2005


On Sun, Jun 26, 2005 at 11:04:32AM +0200, Joachim Durchholz wrote:
> I just ran PmWiki through XDebug and found it's internally generating 
> some warnings. Since that's obfuscating the things that I really want to 
> see, I suggest to avoid them.

I'm always in favor of avoiding warnings.  :-)

> In scripts/diag.php, function DisplayStopWatch():
> The array_pop call generates a warning if $StopWatch isn't set. I.e. it 
> should be rewritten as
>   if (isset($StopWatch)) array_pop($StopWatch);
> or
>   if (is_array($StopWatch)) array_pop($StopWatch);
> I'm not sure what this is supposed to do. As written it just removes the 
> last measurement, which strikes me as strange (but maybe it serves a 
> purpose).

Well, the first line of DisplayStopWatch() adds an entry for "now"
to the list to mark the time at which DisplayStopWatch() is called.
The array_pop() simply removes the "now" entry that DisplayStopWatch 
added to the set, so that we don't get multiple entries for "now".

I'm fixing this using 

   if (is_array($StopWatch)) array_pop($StopWatch);

as suggested above.

Pm



More information about the pmwiki-users mailing list