#1192 Incorrect generated PHP code from C++

php (58)

Hello, after generating PHP interface from attached file by running

swig -c++ -php bugtest.i

please examine bugtest.php, function IStore::FetchDirectoryNextPage() . Instead of returning new IResults object, it silently replaces its internal pointer and returns self. The example seems minimal, when I remove the base class, correct code is generated.

Caused me quite a headache.


  • Juraj Variny

    Juraj Variny - 2011-09-17

    Minimal interface example

  • Olly Betts

    Olly Betts - 2011-09-17

    It's helpful to mention the SWIG version you're using when reporting a bug. This seems to be reproducible with trunk r12813 in a quick test though.

    I thought we'd fixed an issue like this before, but I can't find a bug report about it, nor an entry in CHANGES. I'm afraid I don't have time to dig deeper right now.

    FWIW, the testcase isn't minimal - for example removing the %exception stuff doesn't affect this.


Log in to post a comment.