1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 22:11:12 +02:00
Files
archived-php-src/ext/ffi/tests/023.phpt
Dmitry Stogov 53fc8ef41d Merge branch 'PHP-7.4'
* PHP-7.4:
  Disable instantiation of zero size FFI\CData objects
  Fix # 79171: heap-buffer-overflow in phar_extract_file
  Fix bug #79082 - Files added to tar with Phar::buildFromIterator have all-access permissions
  Fix bug #79221 - Null Pointer Dereference in PHP Session Upload Progress
2020-02-17 12:54:11 +03:00

23 lines
492 B
PHP

--TEST--
FFI 023: GCC struct extensions
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--INI--
ffi.enable=1
--FILE--
<?php
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--
FFI\Exception: Cannot instantiate FFI\CData of zero size
int(4)
int(8)
ok