/php-ffi-go-example

Calling GO functions from PHP via FFI.

Primary LanguagePHPMIT LicenseMIT

PHP FFI GO Example

Just tried to call GO functions from PHP via FFI.

How to run?

Make sure you have PHP 7.4 and ffi.enable=true in your php.ini.

Clone this repository.

git clone https://github.com/eislambey/php-ffi-go-example.git

Build libutil.so

go build -o libutil.so -buildmode=c-shared util.go

Run

php example.php

php http_client_example.php

References