It's a simplified excerpt from real code, just to test/show the problem.
(Note: $b *could* be '', too.)
Code: Select all
$a = '';
$b = 'b';
if ($a = '')
{ $a = $b;
if ($a = '') {$a = 'cc';}
}
Msg $a; The second If correctly recognizes 'False', but nevertheless executes it's conditional code: that's wrong!
"Stepping" shows for the condition of the 2nd If
b = ''
but then the conditional
$a = 'cc'
is wrongly executed!
In the moment when stepping shows
$a = 'cc';
you can look for Variables: $a still contains 'b'! Then it's overwritten.
XYplorer Beta Club