note 89560 deleted from language.oop5.basic by danbrown
| From: | danbrown@php.net | Date: | Fri, 13 Mar 2009 15:54:47 +0000 |
| Subject: | note 89560 deleted from language.oop5.basic by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-151840@lists.php.net to get a copy of this message | ||
Note Submitter: iacopo dot papalini at register dot it
----
As a reply to the note of 'ialsoagree', a solution to his problem may be the following:
(for the lazy: just pass '$this' as a paremeter to the inner function)
<?php
class MyClass {
public $message = 'Hello';
public function MyClassFunction() {
function InnerFunction($theObject) {
echo $theObject->message; // Works fine
}
innerFunction($this);
}
}
$class = new MyClass;
$class->MyClassFunction();
?>