TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
470 B
24 lines
470 B
<?php
|
|
class Example
|
|
{
|
|
private bool $modified = false;
|
|
|
|
public string $foo = 'default value' {
|
|
get {
|
|
if ($this->modified) {
|
|
return $this->foo . ' (modified)';
|
|
}
|
|
return $this->foo;
|
|
}
|
|
set(string $value) {
|
|
$this->foo = strtolower($value);
|
|
$this->modified = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
function main()
|
|
{
|
|
$example = new Example();
|
|
$example->foo = 'Hello World';
|
|
} |