Aer/tests/entry_point.aer

45 lines
712 B
Plaintext
Raw Normal View History

2019-05-08 09:03:21 +02:00
class Test1 {
public void __construct() {
2019-05-08 09:03:21 +02:00
print("Test1::__construct() called.\n");
}
public void __destruct() {
2019-05-08 09:03:21 +02:00
print("Test1::__destruct() called.\n");
}
}
class Test2 extends Test1 {
public void __construct() {
2019-05-08 09:03:21 +02:00
print("Test2::__construct() called.\n");
$parent->__construct();
}
public void __destruct() {
2019-05-08 09:03:21 +02:00
print("Test2::__destruct() called.\n");
$parent->__destruct();
}
}
2019-04-17 17:41:47 +02:00
class Program {
2019-05-08 09:03:21 +02:00
object $test;
2019-04-17 17:41:47 +02:00
public void __construct() {
2019-04-17 17:41:47 +02:00
print("Program::__construct() called.\n");
2019-05-08 09:03:21 +02:00
$this->test = new Test1();
2019-04-17 17:41:47 +02:00
}
public void __destruct() {
2019-04-17 17:41:47 +02:00
print("Program::__destruct() called.\n");
}
public void main() {
2019-04-17 17:41:47 +02:00
print("Program::main() called.\n");
2019-05-08 09:03:21 +02:00
object $test = new Test2();
2019-04-17 17:41:47 +02:00
}
}