From: Miklos V. <vm...@fr...> - 2009-08-14 06:12:08
|
On Thu, Aug 13, 2009 at 12:09:41PM -0600, David Fletcher <fr...@tu...> wrote: > Note that the argument to the __construct() function is $r_, but > there's a case where only '$r' is used (and another case where the > more complete '$r_' is used). So far this looks fine, it should not be a problem that your $r is renamed to $r_. $r is a special param name for the first argument of public ctors, so that if you have a Foo resource, new Foo($r) will return a Foo class for you, having $r in the _cPtr member. > However, there are quite a few other places in php.cxx where only a > plain '$r' is written. In particular, I think this section, around > line 1658, is responsible for producing the line that is failing for > me: > ... > Printf(output, "\t\t\t$c = new stdClass();\n"); > -> Printf(output, "\t\t\t$c->_cPtr = $r;\n"); > Printf(output, "\t\t\treturn $c;\n"); > ... > > If $r were used in just a spot or two, a straighforward fix seems > within reach. But, since '$r' is used in so many places, I'm not sure > of the best way to proceed. I'm not sure I understand what do you want to do. Rename it to $_swig_r or something similar to avoid conflicts? I don't think it matters that a possible $r parameter is _internally_ renamed to $r_. |