Sciuridae says to YSITD
$phar = new Phar("tmp/".$ran."_".$_FILES['file'].".phar"); $phar->setStub(<?php __HALT_COMPILER();); $phar->setSignatureAlgorithm(Phar::SHA1); $phar->startBuffering(); $phar->buildFromDirectory($dir); $phar->stopBuffering();