#41948 [Bgs->Csd]: Cant catch "PHP Catchable fatal error ... must be an instance of ..."

From: Date: Tue, 10 Jul 2007 10:37:36 +0000
Subject: #41948 [Bgs->Csd]: Cant catch "PHP Catchable fatal error ... must be an instance of ..."
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-114837@lists.php.net to get a copy of this message
ID: 41948 User updated by: zolv at t-k dot pl Reported By: zolv at t-k dot pl -Status: Bogus +Status: Closed Bug Type: Scripting Engine problem Operating System: x86_64-2.6.19-gentoo-r4 PHP Version: 5.2.2 New Comment: thx for quick reply. Previous Comments: ------------------------------------------------------------------------ [2007-07-10 10:22:10] jani@php.net Of course not, it's not an exception but just plain and simple error. ------------------------------------------------------------------------ [2007-07-10 10:04:08] zolv at t-k dot pl Description: ------------ catch ( Exception $e) { doesnt catch fatal error exception: PHP Catchable fatal error: Argument 1 passed to AaaCollection::setAaa() must be an instance of Aaa, instance of Bbb given Reproduce code: --------------- <? class Aaa { } class Bbb { } class AaaCollection { public function setAaa( Aaa $aaa ) { } } $bbb = new Bbb(); $aaaCol = new AaaCollection(); try { $aaaCol->setAaa( $bbb ); } catch ( Exception $e) { echo 'Exception has been catched'; } Expected result: ---------------- exception should be catched ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41948&edit=1

« previous php.bugs (#114837) next »