cheers
Paul
From: Neil Smith <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re:Subject: Need Help with Classes
Date: Thu, 13 Feb 2003 13:02:32 +0000
I thought PHP worked like this : to instantiate a class, you need to name a constructor function with the same name as your class. Also var myVar should be var $myVar -- I think setting myVar will create a constant not a variable. Try turning error_reporting(E_ALL) on in your code to catch this sort of error :
class myClass
{
var $myVar;
var $myVarA;
var $myVarB
function myClass($myVarA,$myVarB)
{
....
$this -> myVar = array("b" => 55,"c" => 66);
}
}
That *should* work. No warranty express or implied etc etc lol
Cheers,
Neil Smith.
At 02:23 13/02/2003 +0000, you wrote:
Subject: Need Help with Classes
Ya it seems like a pain indeed. I guess i'll pose the question though: for the following classclass myClass { var myVar; function myFunc($myVarA,$myVarB) { .... $this -> myVar = array("b" => 55,"c" => 66); } } Now i try $somveVar = new myClass(); and finally i try and acces myVar from outside the class: $x = ($someVar->$myVar["u"]); $y = ($someVar->$myVar["v"]); Nada, rien, nicht, no dice... Any help would be appreciated, Paul
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php