RE: [PHP-DEV] One API to rule them all? (Was: Extension Prepend Files)
| From: | François Laupretre | Date: | Sun, 11 Jan 2015 21:42:38 +0000 |
| Subject: | RE: [PHP-DEV] One API to rule them all? (Was: Extension Prepend Files) | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80382@lists.php.net to get a copy of this message | ||
> 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.
Would it be possible to embed C code in a PHP function or method ?
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.
To summarize, I'd like to know how PHP and C code can communicate together.
Regards
François