class DebugExample { private $privateProperty = 1; protected $protectedProperty = 2; public $publicProperty = 3; public $selfProperty; public function __construct() { $this->selfProperty = $this; } public function someMethod() { } } PhpConsole\Connector::getInstance()->getDebugDispatcher()->setDumper(new PhpConsole\Dumper(2, 10, 40)); $s = new stdClass(); $s->asd = array(array(123)); PC::debug(array('null' => null, 'boolean' => true, 'longString' => '11111111112222222222333333333344444444445', 'someObject' => new DebugExample(), 'someCallback' => array(new DebugExample(), 'someMethod'), 'someClosure' => function () { }, 'someResource' => fopen(__FILE__, 'r'), 'manyItemsArray' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11), 'deepLevelArray' => array(1 => array(2 => array(3))))); // Trace debug call PC::getConnector()->getDebugDispatcher()->detectTraceAndSource = true; function a() { b(); } function b() { PC::debug('Message with source & trace detection'); } a(); echo 'See debug messages in JavaScript Console(Ctrl+Shift+J) and in Notification popups. Click on PHP Console icon in address bar to see configuration options.';
/** * @deprecated use log($value, true) instead */ public function logTrace($value) { PC::getConnector()->getDebugDispatcher()->detectTraceAndSource = true; PC::debug($value); PC::getConnector()->getDebugDispatcher()->detectTraceAndSource = false; }