Method always returns the same value (cache?) |
Hello,
I hadĀ a big mistake today that I was not able to solve. I have a method to generate a random string: PHP Code: function RS_RANDOM_STRING(int $length, bool $onlyLetters = false, bool $onlyNumbers = false): string Sometimes, when this method is called, it always returns the same value as if it has beenĀ cached. Another strange thing is that if I call the following method instead of the previous one, I get a new value at each call so no more "cache" mistake. PHP Code: function RS_GENERATE_GUID(bool $lowercase = true, bool $separated = false): string I'm pretty sure I didn't have this problem with older versions of the framework and when I was in PHP 7.4 (now 8.1.2). Does anyone understand why the first method seems to be cached sometimes and always return the same value and the second one always return a new value? |
Messages In This Thread |
Method always returns the same value (cache?) - by RedskyThirty - 03-23-2022, 01:25 PM
RE: Method always returns the same value (cache?) - by InsiteFX - 03-25-2022, 12:52 AM
RE: Method always returns the same value (cache?) - by kenjis - 03-25-2022, 04:27 AM
RE: Method always returns the same value (cache?) - by RedskyThirty - 03-27-2022, 11:55 PM
|