# pecl-php-ffi **Repository Path**: mirrors_php/pecl-php-ffi ## Basic Information - **Project Name**: pecl-php-ffi - **Description**: Foreign Function Interface - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-25 - **Last Updated**: 2026-05-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README $Id$ Usage: First you need to declare the functions and types that you will be using: $win32_idl <<GetTickCount(); echo $ffi->MessageBoxA(0, "The tick count is " . $count, "Ticky Ticky", 1); Structures: =========== You can declare structures in your ffi IDL using C style syntax. Structure support is read-only for the moment. You can pass structures to functions and return them (these two examples work on linux): Passing structs: gettimeofday($tv, $tz) ); printf("tv_sec=%d tv_usec=%d\n", $tv->tv_sec, $tv->tv_usec); ?> Returning Structs: gethostbyname("localhost"); printf("h_length=%d h_name=%s\n", $he->h_length, $he->h_name); ?> Tips: For functions that expect to copy/store memory into a buffer, use str_repeat() to "allocate" room for that buffer. vim:tw=78:et