I agree with your assessment -- these checks are invaluable during development and initial QA, but once your code has stabilized, they're superfluous and just waste time and resources. These checks would be probably be implemented as assertions in other languages, which would be compiled away in production builds.
What would you think about retrofitting most of the ZF plumbing (controller, dispatcher, action base classes, etc.) so these checks would behave more like assertions which could easily be disabled? Something like:
if (! isset(ZEND_DISABLE_ASSERTIONS)) {
// do assertion-style checking
}
// do important code
And then in my bootstrap file, I could globally disable these expensive checks with a one-liner:
define(ZEND_DISABLE_ASSERTIONS, 1);
Sure, there would be a marginal bit of overhead with all of the isset() checks, but they're language constructs, so they're really fast. The difference for development environments would probably be hard to measure, but for production, it should make a noticeable difference.
Feels like Assertions
I agree with your assessment -- these checks are invaluable during development and initial QA, but once your code has stabilized, they're superfluous and just waste time and resources. These checks would be probably be implemented as assertions in other languages, which would be compiled away in production builds.
What would you think about retrofitting most of the ZF plumbing (controller, dispatcher, action base classes, etc.) so these checks would behave more like assertions which could easily be disabled? Something like:
if (! isset(ZEND_DISABLE_ASSERTIONS)) {
// do assertion-style checking
}
// do important code
And then in my bootstrap file, I could globally disable these expensive checks with a one-liner:
define(ZEND_DISABLE_ASSERTIONS, 1);
Sure, there would be a marginal bit of overhead with all of the isset() checks, but they're language constructs, so they're really fast. The difference for development environments would probably be hard to measure, but for production, it should make a noticeable difference.
Thoughts?