Bug #13725: --disable-assert to disable assert() completely?
| From: | yasuo_ohgaki at yahoo dot com | Date: | Thu, 18 Oct 2001 05:25:09 +0000 |
| Subject: | Bug #13725: --disable-assert to disable assert() completely? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-68190@lists.php.net to get a copy of this message | ||
From: yasuo_ohgaki@yahoo.com
Operating system: ANY
PHP version: 4.0.6
PHP Bug Type: Feature/Change Request
Bug description: --disable-assert to disable assert() completely?
If there is assert() in script, function call for assert() is issued at
execution. (If assert is not active, it returns TRUE simply)
It may be nice if there is "--disable-assert" option so that disable
assert() function calls completely for production script. Especially if
there are MANY assert() in scripts. I don't see any reason to call assert()
for production scripts just to return TRUE, even if it a little overhead.
(I'll use a perl script that comments out all assert() from production
scripts for the time being. There are more than 500 assert in my scripts
:)
There are sevral options
1) Change zend_compile.c
2) Change zend_execute.c
3) Implement assert in Zend
4) Leave as it is. Educate users to comment out assert() for production
scripts.
5) Leave as it is. Because it doesn't hart performance much.
6) Other?
It seems this can be done with little change
ZEND_DO_FCALL to ignore assert() in zend_execute.c
or
"zend_do_begin_function_call" to ignore assert() in zend_compile.c
1) or 2) may be easier to implement, but it breaks concept of modulality.
3) is most preffered. 4) is good enough, since it's trivial text
subsutitution.
What do you think?
--
Edit bug report at: http://bugs.php.net/?id=13725&edit=1