Extend this test.
The build was successful.
Details
The build was successful.
Details
This commit is contained in:
parent
a2fb0b9ae5
commit
76880ae4e2
|
@ -1,7 +1,35 @@
|
||||||
|
class Test1 {
|
||||||
|
|
||||||
|
void __construct() {
|
||||||
|
print("Test1::__construct() called.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void __destruct() {
|
||||||
|
print("Test1::__destruct() called.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class Test2 extends Test1 {
|
||||||
|
|
||||||
|
void __construct() {
|
||||||
|
print("Test2::__construct() called.\n");
|
||||||
|
$parent->__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
void __destruct() {
|
||||||
|
print("Test2::__destruct() called.\n");
|
||||||
|
$parent->__destruct();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
class Program {
|
class Program {
|
||||||
|
object $test;
|
||||||
|
|
||||||
void __construct() {
|
void __construct() {
|
||||||
print("Program::__construct() called.\n");
|
print("Program::__construct() called.\n");
|
||||||
|
$this->test = new Test1();
|
||||||
}
|
}
|
||||||
|
|
||||||
void __destruct() {
|
void __destruct() {
|
||||||
|
@ -10,6 +38,7 @@ class Program {
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
print("Program::main() called.\n");
|
print("Program::main() called.\n");
|
||||||
|
object $test = new Test2();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
Program::__construct() called.
|
Program::__construct() called.
|
||||||
|
Test1::__construct() called.
|
||||||
Program::main() called.
|
Program::main() called.
|
||||||
|
Test2::__construct() called.
|
||||||
|
Test1::__construct() called.
|
||||||
Program::__destruct() called.
|
Program::__destruct() called.
|
||||||
|
Test1::__destruct() called.
|
||||||
|
Test2::__destruct() called.
|
||||||
|
Test1::__destruct() called.
|
||||||
|
|
Loading…
Reference in New Issue