[PHP] Re: check if a variable is declared as private

2004-03-02 Thread Jakes
The word private says it all - If you create a object,
you are not going to be able to use it, because its
private to that class. Its a class variable, not a object variable

Vivian Steller [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello,

 is it possible to check if a variable declared as private?
 I do not want to use reflection api in this case...

 ?php
 class MyClass {
 private $var = something;
 }

 $obj = new MyClass();

 // something like this would be nice...
 $isPrivate = isPrivate($obj, var);
 ?

 best regards,
 vivi

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



[PHP] Re: check if a variable is declared as private

2004-03-02 Thread Vivian Steller
Jakes wrote:

 The word private says it all - If you create a object,
 you are not going to be able to use it, because its
 private to that class. Its a class variable, not a object variable
 

oh, yeah - your right of course... taking a look at get_object_vars($obj)
output doesn't show private variables (i expected other behavior) - thats
fine.

thanks anyway
vivi

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