I get the error : "Fatal error: Cannot instantiate non-existent class".
I call :
$Languages = $FootballEye->GetLanguages();
$FootballEye is known is no problem!
$FootballEye.php:
include("Language.php");
class FootballEye
{
...
function GetLanguages()
{
this->$Languages = new $Languages();
}
Now $Languages is not known while I include Language.php in the top of file $FootballEye.php.
Has anybody an idea? Can I use new in a class?
Why does this not work?
Thanks in advance!
Coen Dunnink
The Netherlands
cannot recognize class
Moderator: General Moderators
-
The_Percival
- Forum Newbie
- Posts: 2
- Joined: Sat Jun 04, 2005 5:57 pm
Why should I include the language file at all then?
Why should I include the language file at all then?
Code: Select all
$fb = new FootballEye();
$Languages = $fb->GetLanguages();$this->Languages not this->$Languages - slightly different from C++ Class.
Code: Select all
function GetLanguages()
{
$this->Languages = new $Languages();
// return $this->Languages->something();
}