Hi there !
Im just trying to use a class within a class like the following :
include ("NewClass.inc");
class FirstClass {
var $newClass = new NewClass();
//[...]
function NewClass {
$this->newClass->someFunnyNewClassFunction();
}
}
with this i get the error :
parse error, unexpected T_NEW at [...]
i also tried
$newClass = new NewClass(); //so without the 'var'
with this i get the following :
PHP Parse error: parse error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in [...]
what am i doing wrong ?
I can declare the new Class from within a function, but thats not what i want to do - i want to keep it global, so that i can use this objekt in every function in "FirstClass"