php-src/ext/ffi/tests/017.phpt
Max Semenik bd9f4fa676 Migrate skip checks to --EXTENSIONS--, p2
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
2021-04-01 12:08:24 +01:00

34 lines
743 B
PHP

--TEST--
FFI 017: Structure constraints & tags cleanup
--EXTENSIONS--
ffi
--INI--
ffi.enable=1
--FILE--
<?php
try {
var_dump(FFI::new("struct X {void x();}"));
} catch (Throwable $e) {
echo get_class($e) . ": " . $e->getMessage()."\n";
}
try {
var_dump(FFI::new("struct X {struct X x;}"));
} catch (Throwable $e) {
echo get_class($e) . ": " . $e->getMessage()."\n";
}
try {
var_dump(FFI::new("struct X {struct X *ptr;}"));
} catch (Throwable $e) {
echo get_class($e) . ": " . $e->getMessage()."\n";
}
?>
ok
--EXPECTF--
FFI\ParserException: function type is not allowed at line 1
FFI\ParserException: Struct/union can't contain an instance of itself at line 1
object(FFI\CData:struct X)#%d (1) {
["ptr"]=>
NULL
}
ok