<?php// file: newclass.phpclass Example { function foo() { return "bar!\n"; } }?>
<?php// requires newclass.php (see above)class Example { function foo() { return "foo!\n"; } }$e = new Example();// output originalecho $e->foo();// import replacement methodclasskit_import('newclass.php');// output importedecho $e->foo();?>
The above example will output:
foo! bar!