Add another test - constructor overloading.
已通過所有檢查
The build was successful.

This commit is contained in:
Rafal Kupiec 2019-04-17 12:24:32 +02:00
父節點 9a82298451
當前提交 58618a4d27
簽署人: belliash
GPG 金鑰 ID: 4E829243E0CFE6B4
共有 2 個檔案被更改,包括 20 行新增0 行删除

查看文件

@ -0,0 +1,18 @@
class Test {
object __construct(string $a) {
print("$a\n");
}
object __construct(int $a, int $b) {
print("$a + $b = ", $a + $b, "\n");
}
}
class Program {
void main() {
object $a, $b;
$a = new Test('Hello world!');
$b = new Test(4, 7);
}
}

查看文件

@ -0,0 +1,2 @@
Hello world!
4 + 7 = 11