[phc-general] How compile extensions with classes

Paul Biggar paul.biggar at gmail.com
Thu Feb 25 00:24:15 GMT 2010


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