Getting this error. Has anyone an idea what the error message refers too?
The error points to a class such as
<?php
class user
{ //the third line?
Fatal error: Class declarations may not be nested in includes/DB.php on line 3
thanks
The rest of the code was to much to post.
nested class declarations
Moderator: General Moderators
A class within a class
Does the code look somethng like....
In short, this kind of thing is not allowed.
Later on,
Big Din K.R.
Code: Select all
<?php
class joe_schmo
{
# Then somewhere within
class jane_schmo
{
# Do stuff
}
# End nested class
}
# End original class
?>Later on,
Big Din K.R.
nesting classes
yeah found the problem..
Cant have a required_once("database.php"); inside another class.
but yes you can call a constructor of another class from within this class.
Thanks for your help.
Cant have a required_once("database.php"); inside another class.
but yes you can call a constructor of another class from within this class.
Thanks for your help.
this might interest you about nested classes: http://www.php.net/source.php?url=/zend2_example.php
Its example 3
Its example 3