clean/mpr

打印关于变量的可读信息

1.0.0 2017-04-16 17:56 UTC

This package is auto-updated.

Last update: 2024-09-06 09:09:08 UTC


README

我的 print_r - 调试函数

打印关于变量的可读信息

安装

通过 Composer

使用示例

输出变量并继续

mpr($variable);

输出变量并退出

mpr($variable, 1);

当提供第二个参数时,您将获取从哪个文件调用 mpr 的信息

Who called me: mpr/test.php line 14

输出

对象

--MPR--Foo Object
(
    [name] => Foo
    [data:protected] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
            [3] => 4
        )

)

数组

--MPR--Array
(
    [x] => Hello
    [y] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
            [3] => 4
        )

    [z] => stdClass Object
        (
            [0] => a
            [1] => b
            [2] => c
        )

)

标量

--MPR--string(5) "Hello"