summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2023-04-24 12:17:19 +1200
committerOlly Betts <olly@survex.com>2023-04-24 12:18:52 +1200
commitd45884bab5a881cb1420625ad27c5fccb5b4f6b1 (patch)
tree68c45e180d556d343f36e03c4f04560f7ce7fa0b /Lib
parent01b6268b303919739f15a8681b898e2e65b84cc9 (diff)
downloadswig-d45884bab5a881cb1420625ad27c5fccb5b4f6b1.tar.gz
[php] Add throws typemaps for string* + const string*
Diffstat (limited to 'Lib')
-rw-r--r--Lib/php/std_string.i5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/php/std_string.i b/Lib/php/std_string.i
index 0e2e1faff..5abbbbbef 100644
--- a/Lib/php/std_string.i
+++ b/Lib/php/std_string.i
@@ -56,6 +56,11 @@ namespace std {
goto fail;
%}
+ %typemap(throws) string*, const string* %{
+ zend_throw_exception(NULL, $1->c_str(), 0);
+ goto fail;
+ %}
+
%typemap(in, phptype="string") const string& ($*1_ltype temp) %{
convert_to_string(&$input);
temp.assign(Z_STRVAL($input), Z_STRLEN($input));