ID:               42520
 Updated by:       [EMAIL PROTECTED]
 Reported By:      konstantin at boyandin dot com
 Status:           Open
 Bug Type:         Documentation problem
 Operating System: Windows XP
 PHP Version:      Irrelevant
 New Comment:

I'm only seeing the error, no output using PHP 5.2.4RC4-dev.

What version are you using that shows the 'A' or 'B' as well as the
error message?


Previous Comments:
------------------------------------------------------------------------

[2007-09-02 14:24:01] konstantin at boyandin dot com

Description:
------------
Function with type hinting is executed nonetheless, even if type
mismatch exception occurs.

Reproduce code:
---------------
<?php
$a = new B();
test($a);

class A {
    public $name = 'A';
       
    public function show() {
        print($this->name);
    }
}

class B {
    public $name = 'B';
       
    public function show() {
        print($this->name);
    }
}

function test(A $obj) {
        $obj->show();
}
?>

Expected result:
----------------
Fatal error, nothing displayed 9save error info if output to the
browsers)

Actual result:
--------------
Function is called as if required type was correct *and* fatal error is
generated.


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


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

Reply via email to