Errors are the oldest form of error handling in PHP dating all the way back to PHP 3. Trigger_error is still useful in certain very limited circumstances owing to the fact that, unlike exceptions, errors cannot be caught or if they don't stop the system then code continues on the line following trigger_error. Drupal primarily makes use of Exceptions and assertions, using errors only when necessary to cause an immediate halt of the system.


Exceptions are the preferred method of fault handling in Drupal. They should be used in all cases but two.

Runtime Assertions

A runtime assertion is a statement that is expected to always be true at the point in the code it appears at. They are tested using PHP's internal assert() statement. If an assertion is ever FALSE it indicates an error in the code or in module or theme configuration files. User-provided configuration files should be verified with standard control structures at all times, not just checked in development environments with assert() statements on.

Faults: Assertions, Errors, and Exceptions

(API still in development)

Sooner or later problems occur in all computer programs. There are three problem groups in PHP

Locating Template Files with Debugging

If you want to know which template is generating the markup for a particular element, you can use Twig's built in debug option. This option will render HTML comments alongside your rendered output that include the theme hooks in use, suggested template filenames, as well as denoting the exact Twig file used to render a particular section of your markup.

How to use Xdebug and PhpStorm with VDD

How to use Xdebug and PhpStorm with VDD

VDD supports out of the box Xdebug working configuration. You can simply start your virtual environment, open your project with PhpStorm and start debugging.


To make your debugging more comfortable you should install Xdebug helper extension in your browser. I'll use Google Chrome in this example.


Subscribe with RSS Subscribe to RSS - debugging