php-src/ext/ffi/tests/025.phpt
Max Semenik bd9f4fa676 Migrate skip checks to --EXTENSIONS--, p2
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
2021-04-01 12:08:24 +01:00

45 lines
645 B
PHP

--TEST--
FFI 025: direct work with primitive types
--EXTENSIONS--
ffi
--INI--
ffi.enable=1
--FILE--
<?php
$x = FFI::new("int");
$x->cdata = 5;
var_dump($x);
$x->cdata += 2;
var_dump($x);
echo "$x\n\n";
unset($x);
$x = FFI::new("char");
$x->cdata = 'a';
var_dump($x);
$x->cdata++;
var_dump($x);
echo "$x\n\n";
unset($x);
?>
--EXPECTF--
object(FFI\CData:int32_t)#%d (1) {
["cdata"]=>
int(5)
}
object(FFI\CData:int32_t)#%d (1) {
["cdata"]=>
int(7)
}
7
object(FFI\CData:char)#%d (1) {
["cdata"]=>
string(1) "a"
}
object(FFI\CData:char)#%d (1) {
["cdata"]=>
string(1) "b"
}
b