Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dan-da/strictmode-php

A tiny php include to make php code more strict and catch problems sooner.
https://github.com/dan-da/strictmode-php

php php-strict strictmode

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

README

        

# 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.

app code:

This uses require_once(), see below for autoload example.

```