Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Class problems

Status
Not open for further replies.

JimEkleberry

Programmer
Dec 25, 2001
150
US
Okay, I have a very wierd problem that I am hoping you can help me out with.

I have a user class and an address class that extends the user class.

I have a classes.php file that loads all of the classes. When I attempt to add the address class everything stops. When the address class isn't loaded everything works.

Simple enough; something is wrong with the address class. The catch part is that the address class currently consists of:

Code:
<?php
   class Address extends User {
      // Methods:

      // void Address ([object parent [, array attributes]])

      // This is the constructor method for the Address class.
      // It passes its arguments to the Base class constructor
      // (defined in base.php) to set properties for the object.
      function Address ($parent=&quot;&quot;,$atts=&quot;&quot;) {
         $this->Base($parent,$atts);
      }
   }
?>

which means it is nothing more than a constructor. Even removing the constructor so that only the class line is present still causes everything to fail.

Any ideas on wtf is going on and how to resolve them would be greatly appreciated.

BTW, is there a limit to the number of classes that can be loaded? I have 4 classes loading before this one but didn't think that would be related to the problem.
 
You could easily check the class limit problem by copying just those two classes to another quick script and trying them.
 
Here is some additional information.

The User class extends the Base class.

When I change the Address class from extending the User class to extending the Base class it works.

Any ideas why?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top