summaryrefslogtreecommitdiff
path: root/ext/ffi/tests/011.phpt
blob: 08bd152f0f8d8abb4de779339ace98e34e26263c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--TEST--
FFI 011: cast()
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--INI--
ffi.enable=1
--FILE--
<?php
$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)
}