Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.9

Bug #3369 Profiler : Manual mode generates automatic output
Submitted: 2005-02-03 12:30 UTC
From: ojai at nerim dot net Assigned: toggg
Status: Closed Package: Benchmark
PHP Version: 4.3.4 OS: Linux Debian
Roadmaps: (Not assigned)    
Comments Add Comment Add patch

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 4 + 4 = ?

 [2005-02-03 12:30 UTC] ojai at nerim dot net
Description: ------------ Hi, I'm running Benchmark 1.2.2. When instantiating without automatic profiling : $this->_profiler =& new Benchmark_Profiler(); I get some output even If do not call display(). This comes from Benchmark/Profiler.php, line 161, in the destructor : function _Benchmark_Profiler() { if (isset($this->auto)) { $this->stop(); $this->display(); } } The isset() test evaluates to true even if automatic profiling is disabled, since $this->auto is always set, either to true or false. This issue gets fixed by replacing the isset() test with : if ($this->auto)


 [2005-02-03 12:40 UTC] ojai at nerim dot net
I just realized that this bug has another effect : In manual mode, the Profiler outputs : "reached end of section Global but expecting end of" While everything is set up correctly : I call stop() and display the data by myself. The fact that the destructor calls stop() and display() again seems to trigger this error. Fixing the isset() call, as previously described, fixes this junk output as well.
 [2005-02-11 13:37 UTC] matthias
Yes, probably (isset($this->auto)) should be changed to (isset($this->auto) && $this->auto).
 [2005-02-18 19:59 UTC] matthias
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on In case this was a website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.
 [2005-05-19 09:49 UTC] indeyets at gmail dot com
Matthias, will there be new release of Benchmark any time soon? Living with manually-fixed pear-package makes me nervous :-/
 [2005-05-24 10:56 UTC] toggg
What do you mean with "manually-fixed pear-package" ? Do you have some other features you need to patch for your uses ? Indeed, I will soon make a bug-fix release. Thank you for your feedback.