diff -Nurw Examples/php/callback/example_wrap.cxx Examples/php/callback.good/example_wrap.cxx --- Examples/php/callback/example_wrap.cxx 2009-06-20 11:53:16.000000000 +0200 +++ Examples/php/callback.good/example_wrap.cxx 2009-06-20 11:50:53.000000000 +0200 @@ -1149,6 +1149,8 @@ } void SwigDirector_Callback::run(std::string foo) { + zval *args[1]; + zval arg1; if (!swig_self) { SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); } @@ -1156,8 +1158,11 @@ ZVAL_STRING(&funcname, (char *)"run", 0); + args[0] = &arg1; + ZVAL_STRINGL(&arg1, const_cast(foo.data()), foo.size(), 1); + call_user_function(EG(function_table), &swig_self, &funcname, - &retval, 0, NULL TSRMLS_CC); + &retval, 1, args TSRMLS_CC); return; fail: zend_error(SWIG_ErrorCode(),"%s",SWIG_ErrorMsg());