Newsgroups: php.general,php.internals Path: news.php.net Xref: news.php.net php.general:283344 php.internals:41964 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77690 invoked from network); 17 Nov 2008 10:34:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Nov 2008 10:34:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=pstradomski@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pstradomski@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.92.175 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pstradomski@gmail.com X-Host-Fingerprint: 66.249.92.175 ug-out-1314.google.com Received: from [66.249.92.175] ([66.249.92.175:59917] helo=ug-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/34-53741-C9841294 for ; Mon, 17 Nov 2008 05:34:05 -0500 Received: by ug-out-1314.google.com with SMTP id 39so363566ugf.37 for ; Mon, 17 Nov 2008 02:34:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=+O+va7EeXSL6wJl4dYVa/WCJBFjYxYSj/edPQskiV7g=; b=EpuQpTRMgrejE+WNg00z6TmqB9Ql8d6MtZv6/gnS7pM18N4J3Q6Iq2PKGt3x6TjF60 zl4e+C7fc+rJ2tKFlXuxlkcR2LEcumddStAOJmN4K3vqloWZNhg54opSRm7VsTh9fcjs ADORAjiKmiOX4l1dB/wlUxwDQjBwA3Y2nB8Ro= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:message-id; b=cfAE3NyjEuaCZOdnJw9YpVNJIdZ/nT+h19YoRh/b+rgQYMjQoPwegQ7VqJbpAmEH6g jkZODJXrrQkL/8qEim7hHX0jXGsmL/CpN0P3jlXk6KoTczej7LZIdGTCEOBGXEKzDcNA CNx/BSlcQF5PyYPL0fsfaAVtfiC17w1UnRLLw= Received: by 10.210.142.6 with SMTP id p6mr3799466ebd.100.1226918041906; Mon, 17 Nov 2008 02:34:01 -0800 (PST) Received: from ?192.168.13.108? (hep138.internetdsl.tpnet.pl [79.187.119.138]) by mx.google.com with ESMTPS id 23sm4094579eya.7.2008.11.17.02.34.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 17 Nov 2008 02:34:00 -0800 (PST) Reply-To: =?utf-8?q?Pawe=C5=82_Stradomski?= To: internals@lists.php.net Date: Mon, 17 Nov 2008 11:34:13 +0100 User-Agent: KMail/1.9.9 Cc: Christopher Vogt , php-general@lists.php.net, Jochem Maas References: <28.8E.39815.8C421294@pb1.pair.com> <49212EEF.5070409@iamjochem.com> <49213DBD.8070609@rwth-aachen.de> In-Reply-To: <49213DBD.8070609@rwth-aachen.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-ID: <200811171134.14085.pstradomski@gmail.com> Subject: Re: [PHP-DEV] Fatal error: Call to a member function on a non-object From: pstradomski@gmail.com (=?utf-8?q?Pawe=C5=82_Stradomski?=) W li=C5=9Bcie Christopher Vogt z dnia poniedzia=C5=82ek 17 listopada 2008: > I have a good understanding of OOP. This is not a start for me. I am > just refactoring existing PHP code to be object-oriented. You say there > are plenty of reasons for a Fatal error, so please tell me a few, so I > understand the reasons. You're calling a method. This requires code execution, but the code isn't=20 there. If you were accessing a property of non-existing object (that is, if= =20 you were doing $user->fullname;) then you'd get a warning and NULL. It's no= t=20 so for functions, as they're request for code execution, not for value=20 (remember, not all functions return values as they most important effect -= =20 it's not Haskell). Calling non-existing function returns in fatal error in PHP; it's the same= =20 for: $object->iHaveNoSuchMethod(); $null->method(); nosuchfunction(); =2D-=20 Pawe=C5=82 Stradomski