Fwd: [phc-general] How compile extensions with classes
Rolando Santamaria Maso
rsantamaria at hab.uci.cu
Thu Feb 25 18:23:33 GMT 2010
Hi community,
Apparently the problem is not in the scope, because I remove it.
class Hello
{
function sayHello()
{
return 'Hello';
}
}
I compile the version from the repo, and the error message is the
same:
"Could not generate code for unknown construct"
I have enough experience with PHP,. Net ( > 5 years) but I have never
programmed in C / C + +
My desire is to create extensions that give developers improvements in
PHP OO structures.
Phc may serve me for this?
Thanks again Paul ;)
> ----- Mensaje original -----
> De: "Paul Biggar" <paul.biggar at gmail.com>
> Para: "Rolando Santamaria Maso" <rsantamaria at hab.uci.cu>
> CC: "phc-general" <phc-general at phpcompiler.org>
> Enviados: Miércoles, 24 de Febrero 2010 19:24:15 (GMT-0500)
> Auto-Detected
> Asunto: Re: [phc-general] How compile extensions with classes
>
> Hi Roalndo,
>
> That means that we havent implemented a feature. I think the feature
> is public and private keywords in code generation. It might work if
> you remove the pulbic and private from your code. Fixing it properly
> should not be too difficult if you know C++ and the Zend API.
>
> I think you might be using an old version of phc. The version in the
> repository should give better diagnostics on error.
>
> All the best,
> Paul
>
> On Wed, Feb 24, 2010 at 7:35 AM, Rolando Santamaria Maso
> <rsantamaria at hab.uci.cu> wrote:
> > Hi community, i am new with PHC.
> >
> > I try to create an extension from the following source:
> >
> > class Hello
> > {
> > /**
> > *
> > * @var string
> > */
> > private $prefix;
> >
> >
> >
> > public function Hello()
> > {
> > $this->prefix = '_p__';
> > }
> >
> > /**
> > *
> > * @param string $person_name
> > * @return string
> > */
> > public function sayHello($person_name)
> > {
> > return $this->prefix.'Hello '.$person_name;
> > }
> >
> > }
> >
> > But when I try to compile the extension
> > phc --extension=hello --generate-c hello.php > ext/hello.c
> >
> > I get the following error message:
> > Could not generate code for unknown construct
> >
> > Why is this happening?
> >
> >
> > ---------------------
> > Thanks by default!!!
> > _______________________________________________
> > phc-general mailing list
> > phc-general at phpcompiler.org
> > https://nova.villiros.com/cgi-bin/mailman/listinfo/phc-general
> >
>
>
>
> --
> Paul Biggar
> paul.biggar at gmail.com
More information about the phc-general
mailing list