Typehinting merge #50

已合并
belliash 2019-04-17 11:27:52 +02:00 将 298 次代码提交从 typehinting合并至 master
修改 2 个文件,包含 25 行新增0 行删除
仅显示提交 ee7b1e56ae 的更改 - 显示所有提交

24
tests/extended_closure.aer 普通文件
查看文件

@@ -0,0 +1,24 @@
class Dog {
public string $name;
public string $color;
public void __construct(string $name, string $color) {
$this->name = $name;
$this->color = $color;
}
public callback greet(string $greeting) {
return void() using ($greeting) {
print("$greeting, I am a {$this->color} dog named {$this->name}\n");
};
}
}
class Program {
void main() {
object $dog = new Dog('Alex', 'red');
callback $c = $dog->greet('Hello');
$c();
}
}

查看文件

@@ -0,0 +1 @@
Hello, I am a red dog named Alex