php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22952 Net_Whois: Call to a member function on a non-object in
Submitted: 2003-03-29 09:48 UTC Modified: 2003-06-26 03:56 UTC
From: x4com at web dot de Assigned:
Status: Not a bug Package: PEAR related
PHP Version: 4.3.0 OS: Debian Linux/GNU 3.0r1
Private report: No CVE-ID: None
 [2003-03-29 09:48 UTC] x4com at web dot de
Hello,

I get this error with Net_Whois 1.0.1:

Fatal error: Call to a member function on a non-object in [..]/Whois.php on line 131

My Script is this:

<?php

require_once "./Whois.php";

$server = "whois.denic.de";
$query  = "phpcrawler.de";

$data = Net_Whois::query($server,$query);
echo $data;
?>

My PHP Version is 4.2.2

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-29 20:13 UTC] pollita@php.net
The Net_Whois query method uses $this to refer to the instantiated object.  Since you're attempting to call the method statically there is no instantiation to reference and hence the parses sees:

$whoisData = NULL->_connect($whoisServer, $domain);

which obviously makes no sense.

Instantiate the class, then call the method via your newly created object.
 [2003-05-29 05:42 UTC] ad1 at poorman dot org
when I modify to this,
$whoisData = NULL->_connect($whoisServer, $domain);

it's still have problem like this,
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /home/local/lib/php/Net/Whois.php on line 131

Fatal error: Undefined class name 'net_whois' in /home/richliu/public_html/test/whoistest.php on line 12
 [2003-06-26 03:44 UTC] ad1 at poorman dot org
Example Have problem :<

$whois = new Net_Whois;
$data = whois->query("poorman.org");
echo $data;
 [2003-06-26 03:56 UTC] arnaud@php.net
Please be careful about the code you write, you forgot a $

$whois = new Net_Whois;
$data = $whois->query("poorman.org");
        ^
echo $data;


 [2010-08-01 15:43 UTC] ajaygolani at gmail dot com
<?php
require_once "../Net/Whois.php";

$query  = "softgrid.in";     // get information about
$whois = new Net_Whois;
$data = $whois->query($query);
echo $data;

?>

The code runs fine, but not formatted. Anyone got the well arranged solution??
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 09 07:01:28 2024 UTC