Skip to Content
Mastering PHP 7
book

Mastering PHP 7

by Branko Ajzele
June 2017
Intermediate to advanced
536 pages
9h 49m
English
Packt Publishing
Content preview from Mastering PHP 7

AssertionError

Assertions are runtime checks used as a debugging feature. Using the PHP 7 assert() language construct, we can confirm whether certain PHP expressions are true or false. Whenever the assertion fails, AssertionError is thrown.

The AssertionError class has no methods of its own, they are all inherited from the parent Error class, as per the following class synopsis:

    AssertionError extends Error {      final public string Error::getMessage (void)      final public Throwable Error::getPrevious (void)      final public mixed Error::getCode (void)      final public string Error::getFile (void)      final public int Error::getLine (void)      final public array Error::getTrace (void)      final public string Error::getTraceAsString (void) public string Error::__toString ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning PHP 7

Learning PHP 7

Antonio L Zapata (GBP)
Upgrading to PHP 5

Upgrading to PHP 5

Adam Trachtenberg

Publisher Resources

ISBN: 9781785882814Supplemental Content