2022/10/25: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
(Created page with "category:PHP <syntaxhighlight lang=php> $t1 = FALSE or TRUE; $t2 = FALSE || TRUE; echo "T1=[$t1] T2=[$t2]\n"; die(); </syntaxhighlight> Output: T1=[] T2=[1] That... does...")
 
(No difference)

Latest revision as of 21:31, 25 October 2022

$t1 = FALSE or TRUE;
$t2 = FALSE || TRUE;
echo "T1=[$t1] T2=[$t2]\n"; die();

Output:

T1=[] T2=[1]

That... does not seem right.

Ahh, this offers a clue -- changing the first line to this --

$t1 = (FALSE or TRUE);

-- does in fact fix the problem:

T1=[1] T2=[1]

...but that's totally not the evaluation-order I would have set as the default. "=" should be last.