xref: /PHP-8.2/ext/ffi/tests/011.phpt (revision bd9f4fa6)
1--TEST--
2FFI 011: cast()
3--EXTENSIONS--
4ffi
5--INI--
6ffi.enable=1
7--FILE--
8<?php
9$a = FFI::new("uint8_t[4]");
10$a[0] = 255;
11$a[1] = 255;
12var_dump(FFI::cast("uint16_t[2]", $a));
13?>
14--EXPECTF--
15object(FFI\CData:uint16_t[2])#%d (2) {
16  [0]=>
17  int(65535)
18  [1]=>
19  int(0)
20}
21