Olly Betts - 2013-12-12
  • labels: --> php
  • Description has changed:

Diff:

--- old
+++ new
@@ -1,5 +1,6 @@
 I cannot get polymorphism to work even with directors mecanism.

+~~~~
 struct base {
   virtual void foo();
 };
@@ -7,9 +8,11 @@
   virtual void foo();
 };
 base * create_concrete() { return new concrete; }
+~~~~

 while on the php side:

+~~~~
 %module(directors="1") demo
 %feature("director");      

@@ -17,11 +20,13 @@
 #include "virt.h"
 %}
 %include "virt.h"
+~~~~

 leads to:

+~~~~
 $d = create_concrete();
 if( is_resource($d) )
   echo get_resource_type($d); // output _p_base !
 $d->foo(); // fatal error !
-
+~~~~