dis-bench / src /php /php-src /ext /ffi /tests /011.phpt
meddyrat's picture
Replace repository contents with the original corrected artifact
1e94262
Raw History Blame Contribute Delete
292 Bytes
--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)
}