Dinamically adding methods to an object instance?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've seen that's possible to add public members to objects dinamically, such as:

<?php

class TestClass {
   public $One=1;
}

$Obj = new TestClass ();
$Obj->Two = 2;

echo $Obj->Two;
?>

There'll be a public "Two" member that's not defined in the class.

Is it possible to add methods dinamically to an object instance in same way? how? will these methods have access to private and protected members of the class of the object?

Thanks a lot in advance...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux