Should I be using assert in my PHP code?
- by Darryl Hein
A co-worker has added the assert command a few times within our libraries in places where I would have used an if statement and thrown an exception. (I had never even heard of assert before this.) Here is an example of how he used it:
assert('isset($this->records); /* Records must be set before this is called. */');
I would have done:
if ( !…