Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/kjdev/php-ext-override

Override function Extension for PHP
https://github.com/kjdev/php-ext-override

Last synced: 25 days ago
JSON representation

Override function Extension for PHP

Awesome Lists containing this project

README

        

# Override function Extension for PHP #

[![Build Status](https://secure.travis-ci.org/kjdev/php-ext-override.png?branch=master)](http://travis-ci.org/kjdev/php-ext-override)

This extension allows overrides functions.

## Function ##

* override\_function — Overrides functions

### override\_function — Overrides functions ###

#### Description ####

bool **override\_function** ( string _$name_ , string _$args_ , string _$code_ [ , string _$origin_ ] )

Overrides functions by replacing them in the symbol table.

#### Pameters ####

* _name_

The function to override.

* _args_

The function arguments, as a comma separated string.

* _code_

The new code for the function.

* _origin_

Original function to rename.

#### Return Values ####

Returns TRUE on success or FALSE on failure.

## Examples ##

override_function('test', '$a,$b', 'echo "TEST"; return $a * $b;');
override_function('test', '$a,$b', 'echo "TEST"; return $a * $b;', 'origin_test');