+static zend_object_handlers psi_object_handlers;
+static zend_class_entry *psi_class_entry;
+
+zend_class_entry *psi_object_get_class_entry()
+{
+ return psi_class_entry;
+}
+
+void psi_error_wrapper(PSI_Token *t, int type, const char *msg, ...)
+{
+ va_list argv;
+ const char *fn = NULL;
+ unsigned ln = 0;
+
+ if (t) {
+ fn = t->file;
+ ln = t->line;
+ } else if (zend_is_executing()) {
+ fn = zend_get_executed_filename();
+ ln = zend_get_executed_lineno();
+ } else if (zend_is_compiling()) {
+ fn = zend_get_compiled_filename()->val;
+ ln = zend_get_compiled_lineno();
+ }
+
+ va_start(argv, msg);
+ psi_verror(type, fn, ln, msg, argv);
+ va_end(argv);
+}
+
+void psi_error(int type, const char *fn, unsigned ln, const char *msg, ...)