xref: /php-src/ext/ffi/tests/gh10568.phpt (revision 851e4623)
1--TEST--
2GH-10568 (Assertion failure when var_dump'ing void FFI result)
3--EXTENSIONS--
4ffi
5--SKIPIF--
6<?php
7try {
8    $libc = FFI::cdef("void strlen(const char *s);", "libc.so.6");
9} catch (Throwable $_) {
10    die('skip libc.so.6 not available');
11}
12?>
13--INI--
14ffi.enable=1
15--FILE--
16<?php
17// Yes, I know that strlen does not return void, but I need a simple & portable test case.
18$libc = FFI::cdef("void strlen(const char *s);", "libc.so.6");
19var_dump($libc->strlen("abc"));
20?>
21DONE
22--EXPECT--
23NULL
24DONE
25