|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-05-25 14:15 UTC] steemann at globalpark dot de
[2011-05-26 20:17 UTC] iliaa@php.net
[2011-05-26 20:18 UTC] iliaa@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: iliaa
[2011-05-26 20:18 UTC] iliaa@php.net
[2012-04-18 09:50 UTC] laruence@php.net
[2012-07-24 23:41 UTC] rasmus@php.net
[2013-11-17 09:38 UTC] laruence@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 20:00:01 2025 UTC |
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)