Hello,
I have got two questions for experienced PHP gurus:
1.) The first question is a bit about programming “style”.
Take a case where I have “abstract AClass1” and its’ child “Class1” and a third class “abstract Class2” which is a child of “class1”:
[CODE]
abstract AClass1 {…}
class1 extends AClass1 {…}
abstract class2 extends class1 {…}
Now let’s say i want to seperate all abstract classes from the “real” classes in different files:
file for abstracts:
[CODE]
abstract AClass1 {…}
abstract Class2 extends Class1 {…}
file for “real” classes:
[CODE]
Class1 extends AClass1 {…}
Now obviously in the first file on the definition of “Class2”, “Class1” will be missing. And here goes my question: what is the best way to solve this?
What I do is I require the file needed between the two classes:
[CODE]
abstract AClass1 {…}
require_once(file for “real” classes)
abstract Class2 extends Class1 {…}
This does work (because i have a seperate files for each “real” class) but seems rather ugly to me (doing a “require” out in the nowhere).
How would you do this?
2.) The second question is about “unset” and destructors:
How far does “unset” really go? I mean if you unset an object, is every sub object and array and everything really destroyed?
I am asking since PHP does not support destructors, so one should assume the answer to the above question is yes. But since there is the possibility to imitate destructors through “register_shutdown_function” I was wondering if it is perhaps still necessary to unset certain things “by hand”?