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