xref: /PHP-8.1/ext/ffi/tests/bug78762.phpt (revision bd9f4fa6)
1--TEST--
2Bug #78762 (Failing FFI::cast() may leak memory)
3--EXTENSIONS--
4ffi
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