mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
bd9f4fa676
For rationale, see https://github.com/php/php-src/pull/6787 Make extension checks lowercase, add a special case for opcache that has internal name not matching .so filename. Extensions migrated in part 2: * dom * exif * fileinfo * ffi
32 lines
428 B
PHP
32 lines
428 B
PHP
--TEST--
|
|
FFI 006: Pointer assignment
|
|
--EXTENSIONS--
|
|
ffi
|
|
--INI--
|
|
ffi.enable=1
|
|
--FILE--
|
|
<?php
|
|
$v = FFI::new("int*[2]");
|
|
$v[1] = FFI::new("int[1]", false);
|
|
$v[1][0] = 42;
|
|
var_dump($v);
|
|
FFI::free($v[1]);
|
|
var_dump($v);
|
|
?>
|
|
--EXPECTF--
|
|
object(FFI\CData:int32_t*[2])#%d (2) {
|
|
[0]=>
|
|
NULL
|
|
[1]=>
|
|
object(FFI\CData:int32_t*)#%d (1) {
|
|
[0]=>
|
|
int(42)
|
|
}
|
|
}
|
|
object(FFI\CData:int32_t*[2])#%d (2) {
|
|
[0]=>
|
|
NULL
|
|
[1]=>
|
|
NULL
|
|
}
|