mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27: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.
22 lines
427 B
PHP
22 lines
427 B
PHP
--TEST--
|
|
Bug #77632 (FFI Segfaults When Called With Variadics)
|
|
--SKIPIF--
|
|
<?php
|
|
require_once('skipif.inc');
|
|
try {
|
|
$libc = FFI::cdef("int printf(const char *format, ...);", "libc.so.6");
|
|
} catch (Throwable $_) {
|
|
die('skip libc.so.6 not available');
|
|
}
|
|
?>
|
|
--INI--
|
|
ffi.enable=1
|
|
--FILE--
|
|
<?php
|
|
$libc = FFI::cdef("int printf(const char *format, ...);", "libc.so.6");
|
|
$args = ["test\n"];
|
|
$libc->printf(...$args);
|
|
?>
|
|
--EXPECT--
|
|
test
|