PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Benchmarking » Benchmark » Bug #2957

zero devision when calling getAllSectionsInformations

Details

Submitted2004-12-13 14:23 UTC
Frommaimonoded at yahoo dot com
Assignedmatthias
StatusClosed
PackageBenchmark
PHP Version4.3.9
OSwindows
Roadmaps(Not assigned)

Comments

[2004-12-13 14:23 UTC] maimonoded at yahoo dot com

Description:
------------
package version 1.2.1

when calling to getAllSectionsInformations after a script that runs in less then a second recives:
Warning: Division by zero in \Benchmark\Profiler.php on line 173

Reproduce code:
---------------
<?php
require_once('Benchmark/Profiler.php');

$profiler =& new Benchmark_Profiler(false);

function myFunction()
{
global $profiler;

$profiler->enterSection('myFunction');
echo "in";
$profiler->leaveSection('myFunction');

return;
}

echo "out 1";
myFunction();
echo "out 2";
$info = $profiler->getAllSectionsInformations();
?>

Expected result:
----------------
out 1inout 2

Actual result:
--------------
out 1inout 2
Warning: Division by zero in c:\apachefriends\xampp\php\pear\Benchmark\Profiler.php on line 173