<?phpclass Example { function foo() { return "foo!\n"; } }// create an Example object$e = new Example();// output Example::foo() (before redefine)echo "Before: " . $e->foo();// Redefine the 'foo' methodclasskit_method_redefine( 'Example', 'foo', '', 'return "bar!\n";', CLASSKIT_ACC_PUBLIC);// output Example::foo() (after redefine)echo "After: " . $e->foo();?>
The above example will output:
Before: foo! After: bar!