#1192 Incorrect generated PHP code from C++

open
Olly Betts
php (58)
5
2012-12-21
2011-09-17
Juraj Variny
No

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.

Discussion

  • Juraj Variny
    Juraj Variny
    2011-09-17

    Minimal interface example

     
    Attachments
  • 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.