Bug in PHP 4.2.0-dev
| From: | Martin Jansen | Date: | Tue, 13 Nov 2001 16:48:25 +0000 |
| Subject: | Bug in PHP 4.2.0-dev | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-70366@lists.php.net to get a copy of this message | ||
The following script produces a pretty weird output:
<?php
class Net_Portscan
{
function checkPort($host, $port)
{
$socket = @fsockopen($host,
$port,
$errorNumber,
$errorString,
30);
if (!$socket) {
return 0;
}
return 1;
}
}
echo Net_Portscan::checkPort("127.0.0.1", 80);
?>
The result of the checkPort() call should be either 0 or 1, right?
When executing this script on PHP 4.2.0-dev (latest snapshot),
Apache 1.3.22 and Linux 2.4.0, the output is a number with 9
digits (e.g. 135197452), that randomly changes with each request.
With PHP 4.0.6, Apache 1.3.20 and Debian 2.2r3 it works without
a problem.
Any hints?
- Martin
--
Martin Jansen, <mail@martin-jansen.de>
http://www.martin-jansen.de/