EmielBruijntjes/PHP-CPP — pull request #7 by Photonios (2013-11-24 02:30:15+00:00)
Title: Implemented simple support for throwing exceptions

I felt the need to be able to handle errors, the best way to do this is to throw an exception. I implemented a simple 'static' function in the Php namespace that throws a php exception with the specified error message.

Later, we need to extend this idea, to have the ability to implement your own exception, but for now, this seems good enough.

Here's an example on how it looks:

PHP Fatal error: Uncaught exception 'Exception' with message 'Invalid parameter, expected string.' in /development/rocksdb-php/test.php:4
Stack trace:
#0 /development/rocksdb-php/test.php(4): RocksDB->__construct(NULL)
#1 {main}
thrown in /development/rocksdb-php/test.php on line 4