xref: /php-src/ext/ffi/tests/bug78762.phpt (revision 4acf0084)
1--TEST--
2Bug #78762 (Failing FFI::cast() may leak memory)
3--EXTENSIONS--
4ffi
5--FILE--
6<?php
7try {
8    FFI::cdef()->cast('char[10]', FFI::cdef()->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