jimrubenstein/php-profiler — Issue #4: calculateThreshold if no child
Author: jcabillot
Created: 2012-01-06 14:28:59+00:00
State: open

Hi,

In profiler.php in line 421 (function calculateThreshold) :

self::$trivialThresholdMS = self::$childDurations[ floor(count(self::$childDurations) * self::$trivialThreshold) ];

If you have no child :

floor(count(self::$childDurations) * self::$trivialThreshold -> 0

So your code try to access : self::$childDurations[0], which give you a notice :
Notice: Undefined offset: 0 in [...]php-profiler/profiler.php on line 421

May be you can surround all the with an !empty(self::$childDurations) ...

Best regards,
Julien