Test if method overloading is working properly.
已通過所有檢查
The build was successful.

此提交包含在:
2019-02-07 18:23:37 +01:00
父節點 ed8dab7870
當前提交 6a74bf9e8b
共有 2 個檔案被更改,包括 18 行新增0 行删除

查看文件

@@ -0,0 +1,16 @@
class Program {
function count(int $a, int $b) {
print("Counting 2 integers: $a + $b = ", $a + $b, "\n");
}
function count(float $a, float $b) {
print("Counting 2 floats: $a + $b = ", $a + $b, "\n");
}
function main() {
$this->count(4.3, 5.7);
$this->count(6, 4);
}
}

查看文件

@@ -0,0 +1,2 @@
Counting 2 floats: 4.3 + 5.7 = 10
Counting 2 integers: 6 + 4 = 10