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. Their use is documented at PHP Exceptions. 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

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.

Advanced debugging of Drupal core using the command line (strace & tcpdump)


Debugging of Drupal was never easy, until you know the right tools and how to use them.

There are plenty of alternative debugging methods using some popular PHP libraries XDebug, XHProf, NuSphere PhpED, etc. and also most of the IDE have already built-in step-by-step debugger.


Subscribe with RSS Subscribe to RSS - debugging