Public static boolean property becomes false in __destruct
| From: | Brad Fine | Date: | Mon, 20 Jan 2025 16:46:11 +0000 |
| Subject: | Public static boolean property becomes false in __destruct | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-328619@lists.php.net to get a copy of this message | ||
I have a class with a static public boolean property which is supposed to be false. It's set to false on initialization ("public static boolean $myvar = false;"), and overridden to false again in __construct. I've also dumped the value of the property in nearly every function in my application, and the value remains false.
However, when I actually check the property in a if in the class destructor, it evaluates to true. I've also set a breakpoint with xdebug, which shows the value of the property to be true at this point.
I've done a full search, and nowhere in my application should the value become true; the only place where it's modified is "MyClass::$myvar = false;" at one point.
Does anyone have any idea why the boolean property's value appears to be true in the __destruct, despite never being set to true?
Thank you in advance.