百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
E

exporter

> 编程语言
开源

提供导出 PHP 变量以进行可视化的功能

6.8K stars0 点赞3 次浏览
访问官网GitHub

工具介绍

提供导出 PHP 变量以进行可视化的功能

sebastian/exporter 此组件提供了将 PHP 变量导出以进行可视化的功能。 ## 安装 您可以将此库添加为项目级本地依赖项,以便在项目中使用 Composer: ```

composer require sebastian/exporter 如果您仅在开发阶段需要此库,例如运行项目的测试套件,则应将其添加为开发时依赖项: composer require --dev sebastian/exporter ## 使用 导出:php <?php declare(strict_types=1); use SebastianBergmann\Exporter\Exporter;

$exporter = new Exporter;

/* Exception Object #4 ( 'message' => '', 'string' => '', 'code' => 0, 'file' => '/home/sebastianbergmann/test.php', 'line' => 34, 'previous' => null, ) */

print $exporter->export(new Exception); ## 数据类型 导出简单类型: … 导出复杂类型: … 紧凑型导出:php <?php declare(strict_types=1); use SebastianBergmann\Exporter\Exporter;

$exporter = new Exporter;

// [] print $exporter->shortenedExport([]);

// [...] print $exporter->shortenedExport([1, 2, 3, 4, 5]);

// stdClass Object () print $exporter->shortenedExport(new stdClass);

// Exception Object (...) print $exporter->shortenedExport(new Exception);

// 'this\nis\na\nsuper\nlong\nstr...nspace' print $exporter->shortenedExport( <<<LONG_STRING this is a super long string that wraps a lot and eats up a lot of space LONG_STRING );

##

默认情况下,对象按属性进行导出。实现 `ObjectExporter` 接口可控制某类对象的表示方式:

Issues· 1 开放

查看全部 Issues在 GitHub 打开
  • #77

    依赖关系仪表板

    type/dependencies更新于 2026年9月17日

> 标签

PHP

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月23日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言