Advanced system() for PHP