xref: /PHP-7.4/ext/ffi/tests/bug78761.phpt (revision 59c3ddab)
1--TEST--
2Bug #78761 (Zend memory heap corruption with preload and casting)
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
7?>
8--INI--
9opcache.enable_cli=1
10opcache.preload={PWD}/bug78761_preload.php
11--FILE--
12<?php
13try {
14    FFI::cast('char[10]', FFI::new('char[1]'));
15} catch (FFI\Exception $ex) {
16    echo $ex->getMessage(), PHP_EOL;
17}
18?>
19--EXPECT--
20attempt to cast to larger type
21