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 #4340

Bug in documentation string for Benchmark_Timer

Details

Submitted2005-05-13 10:35 UTC
Fromhoppet at gmail dot com
Assignedtoggg
StatusClosed
PackageBenchmark
PHP Version4.3.3
OSany
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();