PHPackages                             dan-da/strictmode-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dan-da/strictmode-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dan-da/strictmode-php
=====================

v1.0.2(2y ago)080.6k—4.6%3PHP

Since Sep 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/dan-da/strictmode-php)[ Packagist](https://packagist.org/packages/dan-da/strictmode-php)[ RSS](/packages/dan-da-strictmode-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (3)

strictmode-php
==============

[](#strictmode-php)

A tiny php include to make php code more strict and catch problems sooner.

This library catches all PHP notices, warnings, and errors and turns them into PHP exceptions.

It also catches all uncaught exceptions and prints a stack trace. It can also send an email alert for uncaught exceptions.

The net result is that minor problems are caught early in development and it forces the developer to write much cleaner code.

The email alerts are useful for production environments, to notify site operators of any problems.

strictmode.php is a single file that can be included with require\_once or can be included via autoload when using composer.

Let's see an example.
=====================

[](#lets-see-an-example)

app code:

This uses require\_once(), see below for autoload example.

```
