note 78045 deleted from language.oop5.basic by felipe
| From: | felipe@php.net | Date: | Sat, 15 Dec 2007 02:02:02 +0000 |
| Subject: | note 78045 deleted from language.oop5.basic by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133515@lists.php.net to get a copy of this message | ||
Note Submitter: somebody at somewhere dot com
----
It should be noted that PHP, unlike many other OO languages (C++, Java, etc.), doesn't push all
members to the global namespace while inside a method, so when accessing members, going through
$this to do so is NOT optional.
Example:
<?php
// $variable and method() are a member variable and a member function, respectively
$variable = 'foo'; // wrong
$this->variable = 'foo'; // right
method(); // wrong
$this->method() // right
?>