ReflectionClass::isCloneable

(PHP 5 >= 5.4.0, PHP 7)

ReflectionClass::isCloneable锟斤拷锟斤拷锟斤拷一锟斤拷锟斤拷锟角凤拷筛锟斤拷锟�

说锟斤拷

public ReflectionClass::isCloneable ( void ) : bool

锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷欠锟缴革拷锟狡★拷

锟斤拷锟斤拷

锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷愿锟斤拷品锟斤拷锟� TRUE锟斤拷锟斤拷锟津返伙拷 FALSE锟斤拷

锟斤拷锟斤拷

Example #1 ReflectionClass::isCloneable() 锟侥伙拷锟斤拷锟矫凤拷

<?php
class NotCloneable {
    public 
$var1;
    
    private function 
__clone() {
    }
}

class 
Cloneable {
    public 
$var1;
}

$notCloneable = new ReflectionClass('NotCloneable');
$cloneable = new ReflectionClass('Cloneable');

var_dump($notCloneable->isCloneable());
var_dump($cloneable->isCloneable());
?>

锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�

bool(false)
bool(true)