xref: /PHP-7.4/ext/ffi/tests/bug78762.phpt (revision 1e2d3d58)
1--TEST--
2Bug #78762 (Failing FFI::cast() may leak memory)
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7try {
8    FFI::cast('char[10]', FFI::new('char[1]'));
9} catch (FFI\Exception $ex) {
10    echo $ex->getMessage(), PHP_EOL;
11}
12?>
13--EXPECT--
14attempt to cast to larger type
15