1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/ffi/tests/011.phpt

23 lines
292 B
PHP

--TEST--
FFI 011: cast()
--EXTENSIONS--
ffi
--INI--
ffi.enable=1
--FILE--
<?php
$ffi = FFI::cdef();
$a = $ffi->new("uint8_t[4]");
$a[0] = 255;
$a[1] = 255;
var_dump($ffi->cast("uint16_t[2]", $a));
?>
--EXPECTF--
object(FFI\CData:uint16_t[2])#%d (2) {
[0]=>
int(65535)
[1]=>
int(0)
}