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 » Networking » Net_Ping » Bug #1934

outputs for getavg() and getmax() have been reversed

Details

Submitted2004-07-21 05:06 UTC
Fromgsharma at gmail dot com
Assignedjan
StatusClosed
PackageNet_Ping
PHP Version4.3.7
OSWindows 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.