My bad, I wanted to say
zip but, with safe-mode enabled...
Without exec or passthru or "` operator", I cannot see a solution - you need an external program to do the job.
So, you may try
exec("zip -r output/files.zip path/to/dir");
Do it with error_reporting(E_ALL) so you'll know for sure if it works.