getString(); echo "caught exception $a"; } catch (Ex2 $e) { $a = $e->getString(); echo "caught exception $a"; } echo "after exception\n";