Re: Scope of variable in Class
| From: | Lars Torben Wilson | Date: | Tue, 07 Nov 2000 04:13:03 +0000 |
| Subject: | Re: Scope of variable in Class | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24049@lists.php.net to get a copy of this message | ||
Reuben D Budiardja writes:
> Thank you for the quick respond.
> Is there any suggestion how can I effectively "shoot" a user that accesing
> my prefix 'private' variables other than doing code review?
>
> I'm actually developing an API/wrapper using classes. The users that are
> using these classes should not be allowed to access some of the 'private'
> variable (ie. for security reason) from their program. Unfortunatelly,
> until now I allow them to look at the API.
>
> Reuben D. B
I'm afraid you're stuck with code review. I suppose you could just
grep for '->_' not following 'this' in the user code. However, PHP
itself doesn't care where a given member variable is accessed from;
there is nothing builtin which will warn you about it.
--
+----------------------------------------------------------------+
|Torben Wilson <torben@php.net> Netmill iTech|
|http://www.coastnet.com/~torben http://www.netmill.fi|
|Ph: 1 250 383-9735 torben@netmill.fi|
+----------------------------------------------------------------+