RE: [PHP-DEV] One API to rule them all? (Was: Extension Prepend Files)
| From: | Pierre Joye | Date: | Mon, 12 Jan 2015 00:27:29 +0000 |
| Subject: | RE: [PHP-DEV] One API to rule them all? (Was: Extension Prepend Files) | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80393@lists.php.net to get a copy of this message | ||
On Jan 12, 2015 4:42 AM, "François Laupretre" <francois@tekwire.net> wrote:
>
> > De : Pierre Joye [mailto:pierre.php@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. :)