Home » Benchmarking » Benchmark » Bug #4340
Bug in documentation string for Benchmark_Timer
Details
| Submitted | 2005-05-13 10:35 UTC |
|---|---|
| From | hoppet at gmail dot com |
| Assigned | toggg |
| Status | Closed |
| Package | Benchmark |
| PHP Version | 4.3.3 |
| OS | any |
| Roadmaps | (Not assigned) |
Comments
[2005-05-13 10:35 UTC] hoppet at gmail dot com
Description:
------------
The documentation string in Benchmark/Timer.php, example 2, the follwing code is given
<?php
require_once 'Benchmark/Timer.php';
$timer = new Benchmark_Timer();
$timer->start();
$timer->setMarker('Marker 1');
$timer->stop();
$profiling = $timer->getProfiling();
print $profiling->getOutput();
?>
Timer::getProfiling() returns an array, not an object,so the last line fails with "Call to a member function on a non-object".
The last 2 lines could be changed into:
print $timer->getOutput();