mirror of
https://github.com/php/php-src.git
synced 2026-04-20 06:21:12 +02:00
For rationale, see https://github.com/php/php-src/pull/6787 Make extension checks lowercase, add a special case for opcache that has internal name not matching .so filename. Extensions migrated in part 2: * dom * exif * fileinfo * ffi
38 lines
616 B
PHP
38 lines
616 B
PHP
--TEST--
|
|
Bug #79096 (FFI Struct Segfault)
|
|
--EXTENSIONS--
|
|
ffi
|
|
zend_test
|
|
--FILE--
|
|
<?php
|
|
require_once('utils.inc');
|
|
$header = <<<HEADER
|
|
struct bug79096 {
|
|
uint64_t a;
|
|
uint64_t b;
|
|
};
|
|
|
|
struct bug79096 bug79096(void);
|
|
HEADER;
|
|
|
|
if (PHP_OS_FAMILY !== 'Windows') {
|
|
$ffi = FFI::cdef($header);
|
|
} else {
|
|
try {
|
|
$ffi = FFI::cdef($header, 'php_zend_test.dll');
|
|
} catch (FFI\Exception $ex) {
|
|
$ffi = FFI::cdef($header, ffi_get_php_dll_name());
|
|
}
|
|
}
|
|
|
|
$struct = $ffi->bug79096();
|
|
var_dump($struct);
|
|
?>
|
|
--EXPECTF--
|
|
object(FFI\CData:struct bug79096)#%d (2) {
|
|
["a"]=>
|
|
int(1)
|
|
["b"]=>
|
|
int(1)
|
|
}
|