variable scope

From: Date: Tue, 21 Jan 2003 11:01:20 +0000
Subject: variable scope
Groups: php.dev 
Request: Send a blank email to php-dev+get-93576@lists.php.net to get a copy of this message
Hi, I'm coding in PHP5 (ok, it is in pre-alpha-beta-other). I have read about Function scope and if I do not wrong: Class Foo { Function Bar() { print "Bar"; } Function Bar2() { Bar(); } } $f = new Foo(); $f->Bar2(); and it write "Bar". I want to know if this type of scope is equal for the variable: Class Foo { var $foo2; Function Bar() { echo $foo2."\n"; print "Bar"; } Function Bar2() { $foo2="foo2"; Bar(); } } Tnx.

« previous php.dev (#93576) next »