D
D
dev4002016-09-05 15:53:29
PHP
dev400, 2016-09-05 15:53:29

How to debug in php?

In js there is a handy console.log() thing, but in php how to check what value was assigned to a variable?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
OnYourLips, 2016-09-05
@dev400

xdebug is a PHP module for debugging. De facto standard.
It is used together with the IDE, the most popular IDE is PhpStorm (more popular than all the others combined 10 times).

U
Uber Noob, 2016-09-05
@ubernoob

var_dump($var);

M
mletov, 2016-09-05
@mletov

For absolutely trivial cases - var_dump($var). For something more complex - XDebug, PHPDebug, etc., which Google advises.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question