breux / prototype
PHP 5.4 - Prototype
Installs: 18
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/breux/prototype
Requires
- php: >=5.4.1
This package is not auto-updated.
Last update: 2020-01-24 14:47:10 UTC
README
Play with prototype in PHP 5.4!
Example
Class
class Foo { use Prototype\Prototype; }
Add prototype to object (and others objects)
$foo = new Foo; $foo->saidHello = function($lastName) { return "Hello $lastName"; }; echo $foo->saidHello('Julien');
Add prototype to class (for all objects)
Foo::prototype('saidHello', function($lastName) { return "Hello $lastName"; });
Usage
$bar = new Foo; echo $bar->saidHello('Laura');