#22952 [Com]: Net_Whois: Call to a member function on a non-object in

From: Date: Thu, 29 May 2003 10:42:46 +0000
Subject: #22952 [Com]: Net_Whois: Call to a member function on a non-object in
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-16800@lists.php.net to get a copy of this message
ID: 22952 Comment by: ad1 at poorman dot org Reported By: x4com at web dot de Status: Bogus Bug Type: PEAR related Operating System: Debian Linux/GNU 3.0r1 PHP Version: 4.3.0 New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2003-03-29 20:13:15] 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-03-29 09:48:19] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22952&edit=1

« previous php.pear.dev (#16800) next »