diff --git a/CHANGES.current b/CHANGES.current index 3c07efc8c..d5dc669ef 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,6 +5,9 @@ See the RELEASENOTES file for a summary of changes in each release. Version 3.0.11 (in progress) ============================ +2016-09-02: olly + [PHP] Fix out typemap for member function pointers. + 2016-08-22: wsfulton [Python] The following builtin slots can be customized like other slots via the "python:" and "python:slot" features where is the appropriate slot name: diff --git a/Examples/test-suite/php/cpp_basic_runme.php b/Examples/test-suite/php/cpp_basic_runme.php new file mode 100644 index 000000000..6a8522e3e --- /dev/null +++ b/Examples/test-suite/php/cpp_basic_runme.php @@ -0,0 +1,20 @@ +func_ptr = get_func1_ptr(); +check::equal(test_func_ptr($f, 7), 2*7*3, "get_func1_ptr() didn't work"); +$f->func_ptr = get_func2_ptr(); +check::equal(test_func_ptr($f, 7), -7*3, "get_func2_ptr() didn't work"); + +check::done(); +?> diff --git a/Lib/php/php.swg b/Lib/php/php.swg index 45dfb0b0d..535c7d347 100644 --- a/Lib/php/php.swg +++ b/Lib/php/php.swg @@ -393,11 +393,7 @@ { void * p = emalloc(sizeof($1)); memcpy(p, &$1, sizeof($1)); - zval * resource; - MAKE_STD_ZVAL(resource); - ZEND_REGISTER_RESOURCE(resource, p, swig_member_ptr); - - SWIG_SetPointerZval(return_value, (void *)&$1, $1_descriptor, $owner); + ZEND_REGISTER_RESOURCE(return_value, p, swig_member_ptr); } %typemap(in, fragment="swig_php_init_member_ptr") SWIGTYPE (CLASS::*)