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
35 lines
428 B
PHP
35 lines
428 B
PHP
--TEST--
|
|
FFI 026: Array iteration by reference
|
|
--EXTENSIONS--
|
|
ffi
|
|
--INI--
|
|
ffi.enable=1
|
|
--FILE--
|
|
<?php
|
|
$a = FFI::new("int[3]");
|
|
$a[1] = 10;
|
|
$a[2] = 20;
|
|
var_dump($a);
|
|
foreach ($a as &$val) {
|
|
$val->cdata += 5;
|
|
}
|
|
var_dump($a);
|
|
?>
|
|
--EXPECTF--
|
|
object(FFI\CData:int32_t[3])#%d (3) {
|
|
[0]=>
|
|
int(0)
|
|
[1]=>
|
|
int(10)
|
|
[2]=>
|
|
int(20)
|
|
}
|
|
object(FFI\CData:int32_t[3])#%d (3) {
|
|
[0]=>
|
|
int(5)
|
|
[1]=>
|
|
int(15)
|
|
[2]=>
|
|
int(25)
|
|
}
|