<?php public function cloneVar($var, int $filter = 0)
{
$this->prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) {
if (\E_RECOVERABLE_ERROR === $type || \E_USER_ERROR === $type) {
throw new \ErrorException($msg, 0, $type, $file, $line);
}
if ($this->prevErrorHandler) {
return ($this->prevErrorHandler)($type, $msg, $file, $line, $context);
}
return false;
});
$this->filter = $filter;
if ($gc = gc_enabled()) {