diff --git a/Lib/php4/std_string.i b/Lib/php4/std_string.i index 3388d06b4..e1ea9403f 100644 --- a/Lib/php4/std_string.i +++ b/Lib/php4/std_string.i @@ -25,11 +25,19 @@ namespace std { class string; + %typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) string { + $1 = ( Z_TYPE_PP($input) == IS_STRING ) ? 1 : 0; + } + %typemap(in) string { convert_to_string_ex($input); $1 = std::string(Z_STRVAL_PP($input),Z_STRLEN_PP($input)); } + %typemap(typecheck,precedence=SWIG_TYPECHECK_STRING) const string& { + $1 = ( Z_TYPE_PP($input) == IS_STRING ) ? 1 : 0; + } + %typemap(in) const string & (std::string temp) { convert_to_string_ex($input); temp = std::string(Z_STRVAL_PP($input),Z_STRLEN_PP($input));