#41948 [Opn]: Cant catch "PHP Catchable fatal error ... must be an instance of ..."

From: Date: Tue, 10 Jul 2007 10:07:32 +0000
Subject: #41948 [Opn]: 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-114834@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: Open Bug Type: Scripting Engine problem Operating System: x86_64-2.6.19-gentoo-r4 PHP Version: 5.2.3 New Comment: more info about my environment: running on: # php --version PHP 5.2.2-pl1-gentoo (cli) (built: Jun 28 2007 10:11:51) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies with Xdebug v2.0.0RC3, Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, by Derick Rethans p.s. sory, but there is no port for php 5.2.3 on gentoo jet Previous Comments: ------------------------------------------------------------------------ [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 (#114834) next »