PHP Classes

File: examples/rewritting/test.php

Recommend this page to a friend!
  Classes of Nicola Covolo  >  Editable  >  examples/rewritting/test.php  >  Download  
File: examples/rewritting/test.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Editable
Add functions and variables dynamically to objects
Author: By
Last change: Update of examples/rewritting/test.php
Date: 5 months ago
Size: 534 bytes


Class file image Download

//---- replacing existing code ----
$b = new B();
$b->replaceFunction(array($b,"hello"),function(){return "world";});
//---- end ----

echo "<br>---<br>";

//---- replacing live code ----
$b = new B();
$b->addPrivateFunction("world",function(){return "";});
$b->replaceFunction(array($b,"world"),function(){return "World";});
$b->replaceFunction(array($b,"say"),function(){return $this->hello().$this->world() ;});
//---- end ----


For more information send a message to info at phpclasses dot org.