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.
 
 

29 lines
467 B

--TEST--
Native class: clone is native and the class remains invisible to ZendVM
--FILE--
<?php
#[Native]
class NativeCloneValue
{
public int $value = 1;
public function __clone(): void
{
$this->value++;
}
}
function main(): void
{
$first = new NativeCloneValue();
$second = clone $first;
var_dump($first->value, $second->value);
var_dump(class_exists('NativeCloneValue', false));
}
?>
--EXPECT--
int(1)
int(2)
bool(false)