PHP Encapsulation Surprises

PHP Encapsulation Surprises

Note: This article will be emailed to your friend.

In PHP, unlike Java or C++, $this has to be explicitly used to refer to variables within a class.
The value of $this is determined by the context in which it is called. In certain situations $this may actually refer to the invoking class rather then the current class. This breaks object encapsulation.

$this pseudo-variable is [...]

Read the rest of this article (178 words)

Please fill in the following fields

* - Required

Your Name: *

Your E-Mail: *

Your Remarks:

Friend's Name: *

Friend's E-Mail: *

Protected by Comment Guard Pro