Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there anything like Python's ctype for PHP? Accessing libraries without the need to write an extension?

Python has ctypes to access libraries. In PHP you write extensions for everything. Popular extensions like the one for libgd are available almost everywhere.

Is there any extension which works like Python's ctypes, letting you access libraries without the need to write an PHP extension?

like image 456
stesch Avatar asked Jan 28 '10 05:01

stesch


2 Answers

You're looking for ffi.

like image 86
Ignacio Vazquez-Abrams Avatar answered Oct 01 '22 19:10

Ignacio Vazquez-Abrams


PHP 7.3 will have FFI (Foreign Function Interface).

like image 45
stesch Avatar answered Oct 01 '22 20:10

stesch