Edit report at http://bugs.php.net/bug.php?id=54924&edit=1
ID: 54924 Comment by: steemann at globalpark dot de Reported by: andreas dot streichardt at gmail dot com Summary: assert.active is not being reset upon request shutdown Status: Open Type: Bug Package: Unknown/Other Function Operating System: Linux PHP Version: 5.3.6 Block user comment: N Private report: N New Comment: Same issue for assert.warning (ASSERT_WARNING). The value is not reset to the ini setting value at the end of each request if PHP child processes are reused (e.g. in fastcgi mode). Probably the same for assert.bail and friends. Previous Comments: ------------------------------------------------------------------------ [2011-05-25 13:48:50] andreas dot streichardt at gmail dot com Description: ------------ The assert related functions are saving their state in a global structure. The problem is that the assert state is not being reset in the RSHUTDOWN function and thus the assert state of the last request will be used for the next request. Example: If assert is active by default (php.ini assert.active) and you set it to false via assert_options this works fine. However on the next request the default will be that assert is not active. The fix is to add ASSERTG(active)=INI_INT("assert.active"); to asserts RSHUTDOWN function. I am using the FastCGI SAPI. Test script: --------------- var_dump(assert_options(ASSERT_ACTIVE)); assert(false); var_dump(assert_options(ASSERT_ACTIVE,1)); assert(false); var_dump(assert_options(ASSERT_ACTIVE,0)); assert(false); Expected result: ---------------- int(1) Warning: assert() [function.assert]: Assertion failed in xxx.php on line 3 int(1) Warning: assert() [function.assert]: Assertion failed in xxx.php on line 5 int(1) Actual result: -------------- First request: int(1) Warning: assert() [function.assert]: Assertion failed in xxx.php on line 3 int(1) Warning: assert() [function.assert]: Assertion failed in xxx.php on line 5 int(1) Second request (make sure you hit the same pid): int(0) int(0) Warning: assert() [function.assert]: Assertion failed in xxx.php on line 5 int(1) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=54924&edit=1