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 .....
(PHP 7 >= 7.4.0, PHP 8)
FFI\CType::TYPE_VOID
FFI\CType::TYPE_FLOAT
FFI\CType::TYPE_DOUBLE
FFI\CType::TYPE_LONGDOUBLE
FFI\CType::TYPE_UINT8
FFI\CType::TYPE_SINT8
FFI\CType::TYPE_UINT16
FFI\CType::TYPE_SINT16
FFI\CType::TYPE_UINT32
FFI\CType::TYPE_SINT32
FFI\CType::TYPE_UINT64
FFI\CType::TYPE_SINT64
FFI\CType::TYPE_ENUM
FFI\CType::TYPE_BOOL
FFI\CType::TYPE_CHAR
FFI\CType::TYPE_POINTER
FFI\CType::TYPE_FUNC
FFI\CType::TYPE_ARRAY
FFI\CType::TYPE_STRUCT
FFI\CType::ATTR_CONST
FFI\CType::ATTR_INCOMPLETE_TAG
FFI\CType::ATTR_VARIADIC
FFI\CType::ATTR_INCOMPLETE_ARRAY
FFI\CType::ATTR_VLA
FFI\CType::ATTR_UNION
FFI\CType::ATTR_PACKED
FFI\CType::ATTR_MS_STRUCT
FFI\CType::ATTR_GCC_STRUCT
FFI\CType::ABI_DEFAULT
FFI\CType::ABI_CDECL
FFI\CType::ABI_FASTCALL
FFI\CType::ABI_THISCALL
FFI\CType::ABI_STDCALL
FFI\CType::ABI_PASCAL
FFI\CType::ABI_REGISTER
FFI\CType::ABI_MS
FFI\CType::ABI_SYSV
FFI\CType::ABI_VECTORCALL
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 .....