Should I be using assert in my PHP code?

前端 未结 8 1562
执念已碎
执念已碎 2020-12-02 16:07

A coworker 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 o

8条回答
  •  隐瞒了意图╮
    2020-12-02 16:48

    Assert is not a substitute for normal flow control like if or exceptions, because it is only meant to be used for debugging during development.

提交回复
热议问题