fixed "Invalid argument supplied for foreach()" when called from a phar file