mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
bd9f4fa676
For rationale, see https://github.com/php/php-src/pull/6787 Make extension checks lowercase, add a special case for opcache that has internal name not matching .so filename. Extensions migrated in part 2: * dom * exif * fileinfo * ffi
34 lines
700 B
PHP
34 lines
700 B
PHP
--TEST--
|
|
FFI 016: Structure constraints
|
|
--EXTENSIONS--
|
|
ffi
|
|
--INI--
|
|
ffi.enable=1
|
|
--FILE--
|
|
<?php
|
|
try {
|
|
FFI::cdef("struct X {void x();};");
|
|
echo "ok\n";
|
|
} catch (Throwable $e) {
|
|
echo get_class($e) . ": " . $e->getMessage()."\n";
|
|
}
|
|
try {
|
|
FFI::cdef("struct X {struct X x;};");
|
|
echo "ok\n";
|
|
} catch (Throwable $e) {
|
|
echo get_class($e) . ": " . $e->getMessage()."\n";
|
|
}
|
|
try {
|
|
FFI::cdef("struct X {struct X *ptr;};");
|
|
echo "ok\n";
|
|
} catch (Throwable $e) {
|
|
echo get_class($e) . ": " . $e->getMessage()."\n";
|
|
}
|
|
?>
|
|
ok
|
|
--EXPECT--
|
|
FFI\ParserException: function type is not allowed at line 1
|
|
FFI\ParserException: Struct/union can't contain an instance of itself at line 1
|
|
ok
|
|
ok
|