1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 14:01:01 +02:00
Files
archived-php-src/ext/ffi/tests/045.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

28 lines
621 B
PHP

--TEST--
FFI 045: FFI::isNull()
--EXTENSIONS--
ffi
--INI--
ffi.enable=1
--FILE--
<?php
var_dump(FFI::isNull(FFI::new("int*")));
$i = FFI::new("int");
var_dump(FFI::isNull(FFI::addr($i)));
try {
var_dump(FFI::isNull(null));
} catch (Throwable $e) {
echo get_class($e) . ": " . $e->getMessage()."\n";
}
try {
var_dump(FFI::isNull(FFI::new("int[0]")));
} catch (Throwable $e) {
echo get_class($e) . ": " . $e->getMessage()."\n";
}
?>
--EXPECT--
bool(true)
bool(false)
TypeError: FFI::isNull(): Argument #1 ($ptr) must be of type FFI\CData, null given
FFI\Exception: Cannot instantiate FFI\CData of zero size