Assert/fr

Assert is a PHP library that provides an alternative to PHP's  that allows for a simple and reliable way to check preconditions and postconditions in PHP code. It was proposed as a MediaWiki RFC, but is completely generic and can be used by any PHP program or library.

Utilisation
La classe Assert fournit plusieurs méthodes statiques pour vérifier différents types d'assertions. L'utilisation générale est la vérification du type de paramètre, typiquement dans un constructeur ou une méthode set.

Checking parameters, or other assertions such as pre- or postconditions, is not recommended for performance critical regions of the code, since evaluating expressions and calling the assertion functions costs time.

