RE: how to access private property?

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

 



>
> Hello Everyone,
>
>     [code]
>     class MyClass {
>       private $prop;
>     }
>     $obj=new MyClass;
>     [/code]
>
>     is there anyway to read and write MyClass->prop, except serialize
>

Not directly, that's the whole point of declaring something private. You
could use __set and __get methods in the class if you need to but I think
you need to consider your design further first.

Edward

-- 
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