I’ve two classes which are as follows:
class first {
// Somewhere in this class inside a function, class second's
// object is declared.
}
class second {
// Another class
}
When I execute the script using a function inside class first
it shows memory exhausted error.
I tried shifting class second
at top and class first
at bottom and it worked.
But I’m in situation where I cannot do that.
Is there any other way to do that and still declare class seconds object inside class first while class second is declared at bottom only?
NOTE: Both the classes are declared in the same file only.