xref: /PHP-8.4/ext/ffi/tests/005.phpt (revision 4acf0084)
1--TEST--
2FFI 005: Array assignment
3--EXTENSIONS--
4ffi
5--INI--
6ffi.enable=1
7--FILE--
8<?php
9$ffi = FFI::cdef();
10
11$m = $ffi->new("int[2][2]");
12$v = $ffi->new("int[2]");
13$v[1] = 42;
14$m[1] = $v;
15var_dump($m);
16?>
17--EXPECTF--
18object(FFI\CData:int32_t[2][2])#%d (2) {
19  [0]=>
20  object(FFI\CData:int32_t[2])#%d (2) {
21    [0]=>
22    int(0)
23    [1]=>
24    int(0)
25  }
26  [1]=>
27  object(FFI\CData:int32_t[2])#%d (2) {
28    [0]=>
29    int(0)
30    [1]=>
31    int(42)
32  }
33}
34