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

_parseResultwindows not detected on PHP 5

Details

Submitted2006-03-21 09:24 UTC
Fromandreafrancia at sourceforge dot net
StatusDuplicate
PackageNet_Ping
PHP Version5.1.1
OSWindows XP
Roadmaps(Not assigned)

Comments

[2006-03-21 09:24 UTC] andreafrancia at sourceforge dot net

Description:
------------
From class Net_Ping_Result:

function _prepareParseResult($sysname)
{
$parse_methods = array_values(get_class_methods('Net_Ping_Result'));
return in_array('_parseresult'.$sysname, $parse_methods);
} /* function _prepareParseResult() */

This does not work because on PHP5 returns the name of the methods as they were declared (case-sensitive). In PHP 4 they were lowercased. (see warning on "get_class_methods" function php.net documentation).

The code should be something like

if (is PHP4 ) {
return in_array('_parseresult'.$sysname, $parse_methods);
} else { // PHP5
return in_array('_parseResult'.$sysname, $parse_methods);
}