$gen = NEW CLASS {
public function Num() {
$number = mt_rand('0','9');
function Duplicate($number) {
$number = $number.$number;
return $number;
}
return Duplicate($number);
}
};
在旧版本的PHP中,如上所述调用上述函数的方法如下:
echo $gen->Num();