Why is assert limited to a debugging feature only?

From: Date: Thu, 01 Apr 2021 08:24:54 +0000
Subject: Why is assert limited to a debugging feature only?
Groups: php.internals 
Request: Send a blank email to internals+get-113894@lists.php.net to get a copy of this message
Hi,

The documentation of assert (https://www.php.net/manual/en/function.assert.php) states
that's debugging only. This is further enforced by php.ini flags to disable assertions in
production.

Why are the use cases of this feature being limited to debugging? We can see from the popularity of
user-space assertion libraries, like
[webmozart/asset](https://packagist.org/packages/webmozart/assert) and
[beberlei/assert](https://packagist.org/packages/beberlei/assert), that there is a need for runtime
assertions.

[Arnold Daniels - Chat @
Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=yux2k)	[yux2k]


Thread (5 messages)

« previous php.internals (#113894) next »