php var dump function alternative - providing formatted result (extracted from cakephp's core libraries)