Dump PHP variables to the browser console
Simply download the file and include() it in your project.
php:
$a = 42;
console_log($a);Browser console output:
php:
$b = array( 'foo' => 'some value', 'bar' => [
'baz' => 113,
'qux' => null,
'corge' => [0,1,2] ]
);
console_log($b);Browser console output:
php:
class SomeObject
{
private$grault;
publicfunction__construct($val)
{
$this->grault = $val;
}
}
class TestClass
{
public$public_var;
private$private_var;
protected$protected_var;
private$object_var;
publicfunction__construct($public, $private, $protected)
{
$this->public_var = $public;
$this->private_var = $private;
$this->protected_var = $protected;
$this->object_var = newSomeObject(42);
}
}
$testClass = newTestClass('public value','private value', 'protected value');
console_log($testClass);Browser console output:
php:
console_log($a, $b, $testClass);Browser console output:



