Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8929 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85082 invoked by uid 1010); 4 Apr 2004 19:49:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 85057 invoked from network); 4 Apr 2004 19:49:41 -0000 Received: from unknown (HELO conan) (217.148.166.184) by pb1.pair.com with SMTP; 4 Apr 2004 19:49:41 -0000 Received: from [127.0.0.1] (helo=iamjochem.com) by conan with esmtp (Exim 4.30) id 1BADci-0001ar-KV for internals@lists.php.net; Sun, 04 Apr 2004 21:49:40 +0200 Message-ID: <407066D8.50005@iamjochem.com> Date: Sun, 04 Apr 2004 21:49:44 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: PHP internals Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: protected __call() question From: jochem@iamjochem.com (Jochem Maas) the following code does not do what I expect, I made this test case after a new version of PHP5 was put on the system I am developing yesterday and some of my code no longer works: fakeMethod(); } protected function __call($method, $params) { echo 'you called CallMe::'.$method."\n"; } } echo <<< ___THEEND EXPECTED RESULT: ----------------------------------------- you called CallMe::fakeMethod ACTUAL RESULT: ----------------------------------------- ___THEEND; $obj = new CallMe(); $obj->setup(); ?> running the script on 'PHP 5.0.0RC2-dev (cli) (built: Apr 4 2004 13:07:13) (DEBUG)' gives me: EXPECTED RESULT: ----------------------------------------- you called CallMe::fakeMethod ACTUAL RESULT: ----------------------------------------- PHP Fatal error: Call to protected method CallMe::__call() from context '' in /var/www/santos/test/call.protected.php on line 7 Fatal error: Call to protected method CallMe::__call() from context '' in /var/www/santos/test/call.protected.php on line 7 Have I misunderstood the way PHP5 works? Or maybe something is broken? does anyone else get an error? I don't rule out that this could be something specific to the machine I am on, unfortunately I am limited by knowledge and access in determining if this is the case. Kind Regards, Jochem.