ffi.enable=1
--FILE--
<?php
- var_dump(FFI::sizeof(FFI::new("struct {}")));
- try {
- var_dump(FFI::sizeof(FFI::new("struct {}")));
- } catch (Throwable $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
- }
- var_dump(FFI::sizeof(FFI::new("struct {int a}")));
- var_dump(FFI::sizeof(FFI::new("struct {int a; int b}")));
++ try {
++ var_dump(FFI::sizeof(FFI::new("struct {}")));
++ } catch (Throwable $e) {
++ echo get_class($e) . ": " . $e->getMessage() . "\n";
++ }
+ var_dump(FFI::sizeof(FFI::new("struct {int a}")));
+ var_dump(FFI::sizeof(FFI::new("struct {int a; int b}")));
?>
ok
--EXPECT--
--EXPECTF--
bool(true)
bool(false)
-
-Warning: FFI::isNull() expects parameter 1 to be FFI\CData, null given in %s045.php on line %d
-NULL
+TypeError: FFI::isNull() expects parameter 1 to be FFI\CData, null given
- FFI\Exception: FFI\Cdata is not a pointer
+ FFI\Exception: Cannot instantiate FFI\CData of zero size