Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1337 Using $this when not in object context

None
open
Olly Betts
php (58)
5
2014-02-25
2013-09-30
No

I am getting the following error:

$ php -d enable_dl=On test.php
PHP Fatal error: Using $this when not in object context in demo.php on line 90

swig generates:

static function create_concrete() {
    $r=base_create_concrete();
    $this->_cPtr = $r;
    return $this;
}

for the following input C++ code:

struct base
{
virtual void foo() = 0;
static base * create_concrete();
};

Full example is at:
https://github.com/malaterre/PublicRep/tree/master/SWIG/virtualbase

Discussion

  • Olly Betts
    Olly Betts
    2013-12-12

    I'm not really clear how this differs from #1338 - you seem to have linked to the same example code from both...

    It would make investigating easier if the code to reproduce was minimal, and included in the ticket, rather than on some external site as part of a larger codebase.

     
  • Olly Betts
    Olly Betts
    2013-12-12

    • labels: --> php
    • assigned_to: Olly Betts
    • Group: -->