note 22236 added to language.oop
| From: | tobias at schlitt dot info | Date: | Tue, 11 Jun 2002 20:25:41 +0000 |
| Subject: | note 22236 added to language.oop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31711@lists.php.net to get a copy of this message | ||
Just tried finding out some solution for the following code, not working:
[example]
<?
class bar
{
var $name;
function getName()
{
echo $this->name;
}
}
class foo
{
var $bar_field;
function setElement ( $newBar )
{
$this->bar_field = $newBar;
}
function getElement ()
{
return $this->bar_field;
}
}
$test_bar = new bar;
$test_foo = new foo;
$test_foo->setElement($test_bar); // NOT WORKING
$test_foo->getElement()->getName(); // NOT WORKING
?>
Found nothing documentated since now, anyone knows a friendly or maybe even clean solution??
--
http://www.php.net/manual/en/language.oop.php
http://master.php.net/manage/user-notes.php?action=edit+22236
http://master.php.net/manage/user-notes.php?action=delete+22236
http://master.php.net/manage/user-notes.php?action=reject+22236