Re: Again scope
| From: | Maxim Maletsky | Date: | Fri, 31 Jan 2003 21:12:48 +0000 |
| Subject: | Re: Again scope | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-93881@lists.php.net to get a copy of this message | ||
dovrebbe essere:
<?
Class Foo {
var $foo2;
Function Bar()
{
echo $this->foo2."\n";
print "Bar";
}
Function Bar2()
{
$foo2="foo2";
$this->Bar();
}
}
$f = new foo;
$f->Bar2();
?>
--
Maxim Maletsky
maxim@php.net
michel 'ziobudda' morelli <michel@ziobudda.net> wrote... :
> <?
> Class Foo {
> var $foo2;
>
> Function Bar()
> {
> echo $foo2."\n";
> print "Bar";
> }
>
> Function Bar2()
> {
> $foo2="foo2";
> Bar();
> }
> }
>
> $f = new foo;
> $f->Bar2();
> ?>
>
> give me this error:
>
> Fatal error: Call to undefined function: bar() in
> /home/httpd/html/PHP/test/3.php on line 14
>
> I'm using php-cli from cvs (2 weeks ago).
>
> And there is a variable scope (for the class).
>
>
> --
> michel 'ziobudda' morelli <michel@ziobudda.net>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>