O'Reilly logo

Core PHP Programming, Third Edition by Leon Atkinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9.4. Debugging

The debugging functions help you figure out just what is going on with the inevitable broken script. Some of these functions make diagnostic information available to you inside your script. Others communicate with either a system log or a remote debugger. Practical approaches to debugging are addressed in Chapter 28.

assert(boolean expression)assert(string expression)

The assert function (Listing 9.59) tests an expression. If the assertion is TRUE, no action is taken and the script continues. If the assertion is FALSE, behavior is dictated by the assertion options. By default, assertions are not active, which means they are simply ignored. Use assert_options to activate them.

Assertions are a nice way to add error checking to your ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required