From 80eed33825cc477514ce241c59fb82538e0e75f8 Mon Sep 17 00:00:00 2001
From: "Meredith L. Patterson" <mlp@thesmartpolitenerd.com>
Date: Sat, 21 Dec 2013 15:27:57 +0100
Subject: [PATCH] use only zend_throw_exception, not SWIG exception wrappers

---
 src/bindings/php/hammer.i | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/bindings/php/hammer.i b/src/bindings/php/hammer.i
index 3835c283..9f3f7e00 100644
--- a/src/bindings/php/hammer.i
+++ b/src/bindings/php/hammer.i
@@ -42,18 +42,18 @@
     for (i=0; i<size; i++) {
       zval **data;
       if (zend_hash_index_find(arr, i, (void**)&data) == FAILURE) {
-	SWIG_exception(SWIG_IndexError, "index in parser array out of bounds");
 	$1 = NULL;
+	zend_throw_exception(zend_exception_get_default(), "index in parser array out of bounds", 0 TSRMLS_CC);
       } else {
 	res = SWIG_ConvertPtr(*data, &($1[i]), SWIGTYPE_p_HParser_, 0 | 0);
 	if (!SWIG_IsOK(res)) {
-	  SWIG_exception(SWIG_TypeError, "that wasn't an HParser");
+	  zend_throw_exception(zend_exception_get_default(), "that wasn't an HParser", 0 TSRMLS_CC);
 	}
       }
     } 
   } else {
-    SWIG_exception(SWIG_TypeError, "that wasn't an array of HParsers");
     $1 = NULL;
+    zend_throw_exception(zend_exception_get_default(), "that wasn't an array of HParsers", 0 TSRMLS_CC);
   }
  }
 
@@ -157,7 +157,7 @@
 	int res = 0;
 	res = SWIG_ConvertPtr(return_value, (void*)token, SWIGTYPE_p_HParsedToken_, 0 | 0);
 	if (!SWIG_IsOK(res)) {
-	  SWIG_exception(SWIG_TypeError, "hpt_to_php: that wasn't an HParsedToken");
+	  zend_throw_exception(zend_exception_get_default(), "hpt_to_php: that wasn't an HParsedToken", 0 TSRMLS_CC);
 	}
 	// TODO: support registry
       }
-- 
GitLab