Could someone explain me what is &&


(Czihong) #1

Hi, I know && is Logical Operators in programming language.

But when I go through the The [color="#4169E1"]Definite Guide to Yii [/color], here is a example at

http://www.yiiframework.com/doc/guide/form.table documents.

In the actionBatchUpdate() method, there is a statement says: [color="#4169E1"]$valid=$valid && $item->validate();

[/color]

Could anyone tell me what does && means in this case?


(tri - Tommy Riboe) #2

I the first operand evaluates to false, no need to evaluate the second operand.

/Tommy


(Czihong) #3

thanks a lot tommy. make sence now