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.
32 lines
506 B
32 lines
506 B
--TEST--
|
|
Native class: PHP 8.4 property hooks use native getter and setter calls
|
|
--FILE--
|
|
<?php
|
|
|
|
#[Native]
|
|
class NativeHookValue
|
|
{
|
|
private int $stored = 1;
|
|
|
|
public int $value {
|
|
get {
|
|
return $this->stored * 2;
|
|
}
|
|
set(int $value) {
|
|
$this->stored = $value;
|
|
}
|
|
}
|
|
}
|
|
|
|
function main(): void
|
|
{
|
|
$object = new NativeHookValue();
|
|
var_dump($object->value);
|
|
$object->value = 21;
|
|
var_dump($object->value);
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
int(2)
|
|
int(42)
|
|
|