Public static boolean property becomes false in __destruct
Brad Fine <[email protected]> Mon, 20 Jan 2025 17:46:11 +0100
| Newsgroups | gmane.comp.php.general |
|---|---|
| Message-ID | <AS2P192MB204803943CA32AA20B1C9B918DE72@AS2P192MB2048.EURP192.PROD.OUTLOOK.COM> |
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.