I am wondering if PHP will re-use the Parent class. With the following code:
// File parent.php
class Parent {
$public foo = '';
public function __construct($args) {
// ..
}
// .. some functions
}
// File child1.php
class Child1 extends Parent {
public function __construct() {
}
// .. Some overridden function
// .. some extra functions
}
// File child2.php
class Child2 extends Parent {
public function __construct() {
}
// .. some extra functions
}
Now to use either Child1 or Child2 you need to include the parent.php and childN.php. If I only use Child1 I can imagine they are somehow concatenated into a single being. However if I use Child2 on the same page.. would I get 2 'concatenated' beings, that gobble on memory or is PHP super smart and able to see this and only use/load/whatever the Parent only once.
This example is pretty simplified, but the Parent is pretty big and there are plenty of children!