Extend this test.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-05-08 09:03:21 +02:00
parent a2fb0b9ae5
commit 76880ae4e2
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 36 additions and 1 deletions

View File

@ -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();
} }
} }

View File

@ -1,3 +1,9 @@
Program::__construct() called. Program::__construct() called.
Test1::__construct() called.
Program::main() called. Program::main() called.
Program::__destruct() called. Test2::__construct() called.
Test1::__construct() called.
Program::__destruct() called.
Test1::__destruct() called.
Test2::__destruct() called.
Test1::__destruct() called.