Bug #51803 [Com]: Interface implementation silently fails

From: Date: Wed, 12 May 2010 20:09:18 +0000
Subject: Bug #51803 [Com]: Interface implementation silently fails
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-150422@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51803&edit=1

 ID:               51803
 Comment by:       kherge at me dot com
 Reported by:      kherge at me dot com
 Summary:          Interface implementation silently fails
 Status:           Feedback
 Type:             Bug
 Package:          Reproducible crash
 Operating System: Windows XP SP3
 PHP Version:      5.3.2

 New Comment:

Error reporting is currently set to 32767 (E_ALL | E_STRICT).


Previous Comments:
------------------------------------------------------------------------
[2010-05-12 22:05:32] dtajchreber@php.net

Do you have error reporting settings at the right level.. display
errors? I get a nice fatal error as expected..

david@beirut:~$ php test.php 
PHP Fatal error:  Access level to MyClass::_test() must be public (as in
class MyInterface) in /home/david/test.php on line 9

Fatal error: Access level to MyClass::_test() must be public (as in
class MyInterface) in /home/david/test.php on line 9
david@beirut:~$ echo $?
255

------------------------------------------------------------------------
[2010-05-12 21:55:55] kherge at me dot com

Description:
------------
Running the test script, PHP silently exists with the error code 255. 
If you 
remove the protected access type from the _test() function in the
MyClass class, 
the script executes normally.

Test script:
---------------
<?php

    interface MyInterface
    {
        function _test ( );
        function test ( );
    }
    class MyClass implements MyInterface
    {
        protected function _test ( )
        {
            echo 'My _test() function', "\n";
        }
        public function test ( )
        {
            self::_test( );
        }
    }

    MyClass::test( );

Expected result:
----------------
Output: "My _test() function"

Actual result:
--------------
PHP exits with %ERRORLEVEL% = 255


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51803&edit=1


Thread (5 messages)

« previous php.bugs (#150422) next »