I looked at the source code for the PHP 5.3 Sqlite extension, in particular Sqlite.c, which, as I knew, threw an exception and found
via sqlite - https://github.com/php/php-src/blob/PHP-5.3/ext/sqlite/sqlite.c#L46
#include "zend_exceptions.h"
In zend_exceptions.h, it looks like a RuntimeException can be thrown by a simple call
zend_throw_exception(NULL, "Some text")
as described here https://github.com/php/php-src/blob/PHP-5.3/Zend/zend_exceptions.h#L43
The Sqlite3 extension uses it like this:
zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Already initialised DB Object", 0 TSRMLS_CC);
where I conclude that zend_exception_get_default () gets the / handle link for RuntimeException, the second argument is an exception message, and all other work is delegated.
David
source share