略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: FFI\CType

2024-04-25

C Type Handles

(PHP 7 >= 7.4.0, PHP 8)

简介

类摘要

final class FFI\CType {
/* 方法 */
public getAlignment(): int
public getArrayLength(): int
public getAttributes(): int
public getEnumKind(): int
public getFuncABI(): int
public getFuncParameterCount(): int
public getFuncParameterType(int $index): FFI\CType
public getKind(): int
public getName(): string
public getSize(): int
public getStructFieldNames(): array
public getStructFieldOffset(string $name): int
public getStructFieldType(string $name): FFI\CType
}

目录

add a noteadd a note

User Contributed Notes 1 note

up
-1
scorninpc at php dot net
2 years ago
You can compare CTypes if you want to know if the type are correct

\FFI::typeof(\FFI::addr($a)) == \FFI::typeof(\FFI::new("void *"))

CType need some methods, like equal() or toString(), but .....

官方地址:https://www.php.net/manual/en/class.ffi-ctype.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3