when sharing any code please remember to format it as code.
You can use the “Preformatted Text” button from the toolbar.
Guide to Posting Code
from a quick glance at the code you said “for me both functions are equivalent”. What do you mean by this precisely as both functions are not equivalent.
Your first function is comparing string text.
Your second function is casting the variables as booleans by putting a ! in front of them, and also flipping the boolean so if the variable contains anything it’s treated as $false. At that point it’s no longer about what value $tst1 has, just that it does have value. From looking at your tests it always has value so !$tst1 will always be equivalent to $false.
Same thing for the second half of your condition in evaluate_2: as long as $tst1 has value your -eq comparison will return $false.
so we’ve essentially got:
($false) -and ($false)
false and false equals false, so we can shorten that to just $false.
but then you wrapped that and put another not in front of it
(-not($false))
which evaluates as true.
What part of this is boolean algebra?