请使用GCC进行编译!
git clone https://github.com/VikinDev/PDL.git && cd PDL
- libffi
// Debian or Ubuntu
sudo apt-get install libffi-dev
// Mac
brew install libffi
vim ~/.bash_profile
export C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/include/ffi
./install.sh --root enable
which php
export TEST_PHP_EXECUTABLE=which command result
cd PDL && php -f run-test.php
- int
- double
- string
call(string $method_names, array $parameter, string $return_type)
$config = [
'directory' => '/vagrant/www/library'
];
$pdl = new \vikin\PDL($config);
$test = $pdl->open('test.so')
$result = $test->call('test', [1, 2], 'int');
var_dump($result);