以下是我编写的一小段代码:
file_put_contents('a.upl', '');
try
{
$x = new \ZipArchive();
$x->open('a.upl');
}
catch(\Exception $e)
{
echo $e->getMessage();
}
它发出了ZipArchive::open(): Using empty file as ZipArchive is deprecated
的信息,这并不令人惊讶.
令人惊讶的是,这个a.upl
文件被删除了,这有点奇怪.它为什么要这么做?又如何防止这种"x文件,魔术"?