diff --git a/CHANGES.current b/CHANGES.current index 15883747d..68732468c 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,6 +1,11 @@ Version 2.0.0 (in progress) ============================ +2010-05-21: olly + [PHP] Stop generating a bogus line of code in certain constructors. + This was mostly harmless, but caused a PHP notice to be issued, if + enabled (SF#2985684). + 2010-05-18: wsfulton [Java] Fix member pointers on 64 bit platforms. diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx index 700358ee4..c6f01c3e3 100644 --- a/Source/Modules/php.cxx +++ b/Source/Modules/php.cxx @@ -1495,7 +1495,7 @@ public: Printf(prepare, "case %d: ", ++last_handled_i); } if (Cmp(d, "void") != 0) { - if ((!directorsEnabled() || !Swig_directorclass(n)) && !newobject) { + if ((!directorsEnabled() || !Swig_directorclass(n)) && !newobject) { Append(prepare, "$r="); } else { Printf(prepare, "$this->%s=", SWIG_PTR); @@ -1631,11 +1631,13 @@ public: Printf(output, "%s", prepare); if (constructor) { if (!directorsEnabled() || !Swig_directorclass(n)) { - if (strcmp(methodname, "__construct") == 0) { - Printf(output, "\t\t$this->%s=%s;\n", SWIG_PTR, invoke); - } else { - String *classname = Swig_class_name(current_class); - Printf(output, "\t\treturn new %s(%s);\n", classname, invoke); + if (!Len(prepare)) { + if (strcmp(methodname, "__construct") == 0) { + Printf(output, "\t\t$this->%s=%s;\n", SWIG_PTR, invoke); + } else { + String *classname = Swig_class_name(current_class); + Printf(output, "\t\treturn new %s(%s);\n", classname, invoke); + } } } else { Node *parent = Swig_methodclass(n);