On Jan 12, 2015 4:42 AM, "François Laupretre" <franc...@tekwire.net> wrote: > > > De : Pierre Joye [mailto:pierre....@gmail.com] > > > > I have a working proof of concept using something like: > > > > <?php > > function u_foo() { > > } > > ?> > > ---- native > > void foo() > > { > > printf("Hello from native!"); > > } > > ?> > > <?php > > ... some other codes. > > ?> > > In your example, I don't see how you execute the foo() C function from PHP.
PHP_FE/ME are created. I forgot to add foo (); in the example. > Would it be possible to embed C code in a PHP function or method ? Yes, on the plan > If yes, how do both codes access each other's data ? If foo() takes arguments, how would they be transmitted from PHP ? What about scalar type conversions to fit the expected C argument types ? The same about return value. Zpp. And the C function signature for the return value. Also I like to have the base working. The rest is a spec issue and the implementation can change if necessary. :)