PEAR Manual
Prev |  | Next

# Introduction

Introduction -- Purpose and simple usage example

## Description

PHP_Compat provides missing functionality in the form of functions and constants for older versions of PHP.

The replicated functions are designed to be interchangable with their native equivilants. They have the same signature, same return values and throw the same errors. Each function is unit tested to ensure accuracy.

## Example

Example 52-1. Loading a component with PHP_Compat:
    require_once 'PHP/Compat.php';

    PHP_Compat::loadFunction('file_get_contents');

Or, if you don't wish to use the class, you can load it manually.

Example 52-2. Loading a component manually:
    require_once 'PHP/Compat/Function/file_put_contents.php';

The function is then ready to use like you would normally.

PHP_Compat is designed for ease of use. It has no dependencies and can be used completely outside the PEAR infrastructure.

Prev | Home | Next
PHP_Compat | Up | Components