Python's with statement for PHP