Is it possible to call PHP C functions in a C program?

When you load a PHP source, you understand that all the goodies are in the directory ext/in the corresponding files array.c, string.cetc.

Now, I was wondering, can I call these functions from a C program that has these PHP C files?

+3
source share
3 answers

You can do it, but that does not mean that it is a good idea. PHP library functions relate to PHP internal data types, memory allocation and management schemes, etc. You probably ended up spending a lot of time and effort sorting data between PHP and C.

, , C C ( C). , , PHP , PHP.

, , , , , . C, C, C PHP .

+4

, . , PHP , PHP, , PHP .

, C- PHP, PHP-.

PHP- C-, , .

- , PHP- BSD, , , , .

+3

OK, why not? Just resolve any dependencies and release ...

Of course, licensing is worth checking out. But the code is wise, it should work.

+1
source

Source: https://habr.com/ru/post/1782855/


All Articles