- var_dump: documentation ( source)
<?php
class DatabaseConnection
{
}
class DoStuff
{
protected $connection;
public function __construct(DatabaseConnection $connection)
{
$this->connection = $connection;
}
public function someQuery()
{
$this->connection->query("SELECT ... blah blah blah");
}
public function __debugInfo()
{
return array('no', 'soup', 'for', 'you');
}
}
$stuff = new DoStuff(new DatabaseConnection);
var_dump($stuff);