Home » Networking » Net_Ping » Bug #1934
outputs for getavg() and getmax() have been reversed
Details
| Submitted | 2004-07-21 05:06 UTC |
|---|---|
| From | gsharma at gmail dot com |
| Assigned | jan |
| Status | Closed |
| Package | Net_Ping |
| PHP Version | 4.3.7 |
| OS | Windows XP |
| Roadmaps | (Not assigned) |
Comments
[2004-07-21 05:06 UTC] gsharma at gmail dot com
Description:
------------
Version Info: $Id: Ping.php,v 1.36 2004/02/08 23:17:22 jan Exp $
the output for the functions getavg and getmax in the Ping.php has been interchanged.
Reproduce code:
---------------
Script Producing Error:
<?php
require_once 'Net_Ping/Ping.php';
$ping = Net_Ping::factory();
if(PEAR::isError($ping)) {
die($ping->getMessage());
}
$ping->setArgs(array('count' => 4));
$result = $ping->ping('php.net');
$minping = $result->getMin();
$maxping = $result->getMax();
$avgping = $result->getAvg();
echo "Minping: ".$minping."<br />Maxping: ".$maxping."<br /> Avgping: ".$avgping;
?>
Expected result:
----------------
It should print the min, max and avg values respectively.
Actual result:
--------------
It prints min, avg, max values respectively.
Solution: Error lies between the lines 688 - 693 in Ping.php
[2004-07-21 08:43 UTC] gsharma at gmail dot com
thanks, it does solve the problem (atleast for me)!
I am not sure if I am supposed to change the bug status or not.
Thanks again.