TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

32 lines
537 B

--TEST--
FFI multidimensional array assignment keeps CData containers
--EXTENSIONS--
ffi
--ENV--
USE_ZEND_ALLOC=0
--INI--
ffi.enable=1
--FILE--
<?php
function main(): void
{
$ffi = FFI::cdef();
$matrix = $ffi->new("int[2][2]");
$row = $ffi->new("int[2]");
$row[0] = 11;
$row[1] = 22;
$matrix[1] = $row;
var_dump($matrix instanceof FFI\CData);
var_dump($row instanceof FFI\CData);
var_dump(FFI::sizeof($matrix));
var_dump(FFI::sizeof($row));
}
?>
--EXPECT--
bool(true)
bool(true)
int(16)
int(8)