[php-src] Issue #16013: endianness issue with FFI (`ext/ffi/tests/gh11934.phpt`)

From: Date: Mon, 23 Sep 2024 19:08:12 +0000
Subject: [php-src] Issue #16013: endianness issue with FFI (`ext/ffi/tests/gh11934.phpt`)
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-247868@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/16013 Author: NattyNarwhal ### 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

« previous php.bugs (#247868) next »