mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.2'
* PHP-8.2: Fix assertion failure when var_dump'ing void FFI result (#10568)
This commit is contained in:
commit
2abb5850ba
2 changed files with 27 additions and 0 deletions
|
@ -2038,6 +2038,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:
|
||||
|
|
25
ext/ffi/tests/gh10568.phpt
Normal file
25
ext/ffi/tests/gh10568.phpt
Normal file
|
@ -0,0 +1,25 @@
|
|||
--TEST--
|
||||
GH-10568 (Assertion failure when var_dump'ing void FFI result)
|
||||
--EXTENSIONS--
|
||||
ffi
|
||||
--SKIPIF--
|
||||
<?php
|
||||
try {
|
||||
$libc = FFI::cdef("void strlen(const char *s);", "libc.so.6");
|
||||
} catch (Throwable $_) {
|
||||
die('skip libc.so.6 not available');
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
ffi.enable=1
|
||||
--FILE--
|
||||
<?php
|
||||
// Yes, I know that strlen does not return void, but I need a simple & portable test case.
|
||||
$libc = FFI::cdef("void strlen(const char *s);", "libc.so.6");
|
||||
var_dump($libc->strlen("abc"));
|
||||
?>
|
||||
DONE
|
||||
--EXPECT--
|
||||
object(FFI\CData:void)#2 (0) {
|
||||
}
|
||||
DONE
|
Loading…
Add table
Add a link
Reference in a new issue