Hi! Nice that FFI is of interest again, so may I kindly point you to ext-psi? https://github.com/m6w6/ext-psi
It follows a different approach, though, that it requires definition
files on startup, not at runtime.
Basically:
$ cat >time.psi <<EOF
#include <time.h>
/* time_t time(time_t *tloc); man 2 time */
function psi\time() : int {
let tloc = NULL;
return time(tloc) as to_int(time);
}
EOF
$ ./sapi/cli/php -d psi.directory=. -r 'var_dump(psi\time());'
It stalled the last months because I have been fighting health issues
since last summer, but I did post a link to internals about a year ago:
https://externals.io/message/98212#98259
--
Regards,
Mike
signature.asc
Description: OpenPGP digital signature
