diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c index 8e389da2689..ec645350ac4 100644 --- a/ext/ffi/ffi.c +++ b/ext/ffi/ffi.c @@ -2028,6 +2028,8 @@ static HashTable *zend_ffi_cdata_get_debug_info(zend_object *obj, int *is_temp) } switch (type->kind) { + case ZEND_FFI_TYPE_VOID: + return NULL; case ZEND_FFI_TYPE_BOOL: case ZEND_FFI_TYPE_CHAR: case ZEND_FFI_TYPE_ENUM: diff --git a/ext/ffi/tests/gh10568.phpt b/ext/ffi/tests/gh10568.phpt new file mode 100644 index 00000000000..bd76671438d --- /dev/null +++ b/ext/ffi/tests/gh10568.phpt @@ -0,0 +1,25 @@ +--TEST-- +GH-10568 (Assertion failure when var_dump'ing void FFI result) +--EXTENSIONS-- +ffi +--SKIPIF-- + +--INI-- +ffi.enable=1 +--FILE-- +strlen("abc")); +?> +DONE +--EXPECT-- +object(FFI\CData:void)#2 (0) { +} +DONE