Thread PHP Fatal Error => Exception? (3 answers)
Opened by rosti at 2012-06-02 12:20

rosti
 2012-06-02 12:20
#158710 #158710
User since
2011-03-19
3212 Artikel
BenutzerIn
[Homepage]
user image
Hi,

was in Perl geht, stelle ich mir für PHP so vor:

Code: (dl )
1
2
3
4
5
6
7
8
$class = 'Baz'; // Aus meiner Config heraus soll die Klasse 'Baz' heißen
try{
$foo = new $class;
}
catch(Exception $e){
// hier soll was Eigenes gemacht werden
// fliege aber vorher schon raus mit 'PHP Fatal error: Class 'Baz' not found'
}


try/catch funktioniert also nicht, weil ich vorher schon rausfliege. Was muss ich tun, damit ich in den catch-Zweig komme?

Viele Grüße,
Rosti

View full thread PHP Fatal Error => Exception?