Hello Jani, Wednesday, April 14, 2004, 3:35:23 AM, you wrote:
> On Wed, 14 Apr 2004, Marcus Boerger wrote: >>> This is actually a pretty nasty side effect of throwing exceptions in >>> ctors because these two lines have *very* different results if they >>> fail: >> >>> $db = new SQLiteDatabase(); >>> $db = sqlite_open(); >> >>> The first is fatal; the second isn't. > So to use the OO API of sqlite requires that I use > exceptions with it too..? It's pretty unfriendly to force > the use of exceptions like this, IMO. As i explained there is no good other way to tell the user the ctor has failed. The two ways out out are: 1) Using empty ctors and check whetehr the instance is initialized on every method call which is slower and different from our other objects. 2) Pass another parameter by reference '&$failed' which will hold the state of the ctor execution. Still you need to solve the now illegal instance which pretty much leads to 1. Hey if you want to work with OO then deal with all OO issues or create ugly workarounds and don't pretend the language is OO at all. And after all exceptions can have a nice benefit. -- Best regards, Marcus mailto:[EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php