#784 [php5] autorename of reserved method names not implemented

closed-fixed
php (58)
5
2009-07-28
2006-12-12
No

I had a problem converting a C++ method with the name `print' since it is a PHP keyword.

This appears to be a known TODO item judging from the comments in php4.cxx

``* Sort out auto-renaming of method and class names which are reserved
* words (e.g. empty, clone, exception, etc.) vs -php4/-php5 in some
* sane way.''

but you didn't appear to have a bug open for it.

Discussion

  • David Walluck

    David Walluck - 2006-12-12
    • summary: problem with methods with same name as resrved words --> problem with methods with same name as PHP resrved words
     
  • Olly Betts

    Olly Betts - 2006-12-14

    Logged In: YES
    user_id=14972
    Originator: NO

    Yes, this hasn't been implemented yet. Generally the autorenaming doesn't
    do a good enough job anyway (though it does at least mean that working
    code is generated, which is indeed desirable).

    For example, the autorenaming would rename "print" to "c_print", so for
    a decent quality wrapper you'd generally want to rename the method by
    hand to something more appropriate to the class library being wrapped
    (e.g. "print_file" or "print_document" perhaps).

    You can do that by just adding this near the start of your .i file (see
    the C++ chapter of the documentation for more details):

    %rename(print_file) Foo::print;

     
  • Olly Betts

    Olly Betts - 2006-12-14
    • assigned_to: kruland --> olly
    • summary: problem with methods with same name as PHP resrved words --> [php5] autorename of reserved method names not implemented
     
  • Olly Betts

    Olly Betts - 2009-07-28
    • status: open --> closed-fixed
     
  • Olly Betts

    Olly Betts - 2009-07-28

    Fixed in trunk r11460.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks