Re: "use strict" or similar in PHP?

From: Date: Fri, 27 Feb 2009 17:03:21 +0000
Subject: Re: "use strict" or similar in PHP?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-288931@lists.php.net to get a copy of this message
Bob McConnell wrote:
From what I have seen of PHP, it is strictly interpreted. i.e. a line is read, and executed. Then the next line is read, and executed. etc. So there is no way to get it to block execution from the beginning even when there are fatal errors. It will already have printed out as much of the page as it executed before it finds those errors. This works fine in a development or test environment, but is a serious problem in production.
You can use something like DOMDocument where you store the intended user output in an object until you are actually ready to do something with it (IE send it to the client as a complete documet). If all error reporting is turned off (like it should be on a production machine) nothing is sent to output until the output is fully constructed. Is that what you are after?

« previous php.general (#288931) next »