How to print the current call stack, function arguments and local variables?

8 years ago

David Grudl
Nette Core | 6886

How to stop program execution and print current function, its arguments, call stack and local variables?

We need to activate Debugger in strict mode:

Debugger::$strictMode = TRUE

(or using $configurator->enableDebugger()).

Than simply call $stop() in place you want to break program execution and show all information:

public function authenticate(array $credentials)
    list($username, $password) = $credentials;
    $row = $this->users->where('username', $username)->fetch();


Debugger will show you all information in eye-candy format.