Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41959 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62318 invoked from network); 17 Nov 2008 09:31:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Nov 2008 09:31:45 -0000 X-Host-Fingerprint: 85.176.147.180 e176147180.adsl.alicedsl.de Received: from [85.176.147.180] ([85.176.147.180:6513] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 88/21-53741-5F931294 for ; Mon, 17 Nov 2008 04:31:40 -0500 Message-ID: <88.21.53741.5F931294@pb1.pair.com> To: internals@lists.php.net Date: Mon, 17 Nov 2008 10:31:29 +0100 User-Agent: Thunderbird 2.0.0.17 (Macintosh/20080914) MIME-Version: 1.0 References: <28.8E.39815.8C421294@pb1.pair.com> In-Reply-To: <28.8E.39815.8C421294@pb1.pair.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 85.176.147.180 Subject: Re: Fatal error: Call to a member function on a non-object From: karsten@typo3.org (Karsten Dambekalns) Hi. Christopher Vogt wrote: > I fetch records a database. Sometime it happens that a record does not > exist anymore. Let's assume it's a user, then $user will be NULL. > > echo $user['fullname']; // no error at all, $user['fullname'] === NULL > > Shouldn't this at least trigger a Notice? Check your error handling settings, probably warnings/notices are disabled. > echo $user->get_fullname(); // Fatal error Well, is $user an object? If not, well, better not call a method on it. Regards, Karsten PS: I am not sure this is a topic for php.internals...