ffi/var-dumper
最新稳定版本:1.0.2
Composer 安装命令:
composer require ffi/var-dumper
包简介
List of symfony/var-dumper casters with FFI support
README 文档
README
This library allows you to dump FFI types using the functions dd() and dump().
Requirements
- PHP >= 8.1
Installation
Library is available as composer repository and can be installed using the following command in a root of your project.
$ composer require ffi/var-dumper
Usage
dump(\FFI::new('struct { float x }')); // // Expected Output: // // struct <anonymous> { // x<float>: 0.0 // } //
Unsafe Access
Some values may contain data that will cause access errors when read. For example, pointers leading to "emptiness".
Such data is marked as "unsafe" and only the first element is displayed. If you
want to display the values in full, you should use the VAR_DUMPER_FFI_UNSAFE=1
environment variable.
// Create char* with "Hello World!\0" string. $string = \FFI::new('char[13]'); \FFI::memcpy($string, 'Hello World!', 12); $pointer = \FFI::cast('char*', $string); // Dump dump($pointer); // VAR_DUMPER_FFI_UNSAFE=0 // // > char* (unsafe access) { // > +0: "H" // > } // VAR_DUMPER_FFI_UNSAFE=1 // // > b"Hello World!\x00"
统计信息
- 总下载量: 10.13k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 20
- 点击次数: 1
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-31