kint-php / kint

Kint - Advanced PHP dumper
https://kint-php.github.io/kint/
MIT License
2.77k stars 290 forks source link

How to add output of d($something) to end of html output? #178

Closed dmueller-workmatrix closed 8 years ago

dmueller-workmatrix commented 8 years ago

Hi there, first of all - thanks for this helpful debugging tool!

I'm having trouble with kint breaking utf8 browser encoding detection. This unpolished additional funktion helped me:

if ( !function_exists( 'de' ) ) {
    /**
     * Alias of Kint::dump() but will be excecuted on php shutdown
     *
     * @return string
     */
    function de()
    {
        if ( !Kint::enabled() ) return '';
        $_ = func_get_args();
        register_shutdown_function(function() use ($_) {
            return call_user_func_array( array( 'Kint', 'dump' ), $_ );
        });
    }
}

This might be a nice addition, even if unrelated to my utf8 problem.

raveren commented 8 years ago

Hi!

The functionality request you are talking about is duplicated by #50 and if you have character encoding problems, please report them to #172, and I'll come to them as soon as I'm able.