Closed
Description
Description
Caught this when provisioning a big endian box for CI.
diff output on test:
--
--- Struct ---
bool(true)
--- Callback return type ---
044- int(42)
044+ int(0)
--- Other FFI\CData assignment ---
int(123)
--- Array element ---
--
The relevant part of that test:
echo "--- Callback return type ---\n";
$ffi = FFI::cdef('
typedef uint32_t (*test_callback)();
typedef struct {
test_callback call_me;
} my_struct;
');
$struct = $ffi->new('my_struct');
$struct->call_me = function () use ($ffi) {
$int = $ffi->new('uint32_t');
$int->cdata = 42;
return $int;
};
var_dump(($struct->call_me)());
Not familiar with FFI, so haven't looked into it yet, but making a note.
PHP Version
PHP 8.4.0-DEV
Operating System
Gentoo/ppc64