For example :
$sandbox = new PHPSandbox;
function test ($values)
{
return $values;
}
$sandbox->whitelistFunc(['test','dd']);
$sandbox->allow_casting = true;
$result = $sandbox->execute(function(){
return test(['required','date', 'copy']);
});
print_r(
$result ,
);