note 10256 modified in language.references.spot by irc-html
| From: | irc-html@php.net | Date: | Sat, 19 Jan 2002 20:24:16 +0000 |
| Subject: | note 10256 modified in language.references.spot by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-25297@lists.php.net to get a copy of this message | ||
You can, in php 4.0.4, redirect $this..
<?
class foo
{
function doit(&$input) //constructor
{ $this &= $input; }
function print()
{ echo "foo"; }
}
class bar
{
function print()
{ echo "bar"; }
}
$foo=new foo;
$bar=new bar;
$foo->print();
$foo->doit();
$foo->print();
?>
Will print:
foobar
--was--
You can, in php 4.0.4, redirect $this..
<pre>
<?
class foo
{
function doit(&$input) //constructor
{ $this &= $input; }
function print()
{ echo "foo"; }
}
class bar
{
function print()
{ echo "bar"; }
}
$foo=new foo;
$bar=new bar;
$foo->print();
$foo->doit();
$foo->print();
</pre>
Will print:
foobar
http://www.php.net/manual/en/language.references.spot.php