pkboom/dump-variable

按变量名导出

0.0.4 2022-02-13 05:10 UTC

This package is auto-updated.

Last update: 2024-09-13 10:58:57 UTC


README

有时候你可能想在php中像js一样导出一个带名称的变量

let name = "foo";

console.log({ name });

// { name: 'foo'}

你可以使用php中的dv()dvd()来实现

$name = 'foo';

// dump with variable
dv($name);

// dd with variable
dvd($name);

// [ '$name' => 'foo' ]

安装

composer require pkboom/dump-variable --dev