mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
cdfe11f80d
Fixes a bug in test added in
5661feb1ef
, by checking that the
relevant SO exists.
Also adds an additional test that is based on zend_printf, and
should work on both Linux and Windows.
25 lines
554 B
PHP
25 lines
554 B
PHP
--TEST--
|
|
Bug #77632 (FFI function pointers with variadics)
|
|
--SKIPIF--
|
|
<?php
|
|
require_once('skipif.inc');
|
|
try {
|
|
FFI::cdef("extern void *zend_printf;");
|
|
} catch (Throwable $_) {
|
|
die('skip PHP symbols not available');
|
|
}
|
|
?>
|
|
--INI--
|
|
ffi.enable=1
|
|
--FILE--
|
|
<?php
|
|
$libc = FFI::cdef("extern size_t (*zend_printf)(const char *format, ...);");
|
|
$args = ["test from zend_printf\n"];
|
|
($libc->zend_printf)(...$args);
|
|
$args2 = ["Hello, %s from zend_printf\n", "world"];
|
|
($libc->zend_printf)(...$args2);
|
|
?>
|
|
--EXPECT--
|
|
test from zend_printf
|
|
Hello, world from zend_printf
|