Zend Studio reports warning: Assignment in condition. Is this so bad?

后端 未结 8 1645
轻奢々
轻奢々 2020-12-11 02:47

I have recently started using Zend Studio which has reported as warning the following type of code:

$q = query(\"select * from some_table where some_conditio         


        
8条回答
  •  鱼传尺愫
    2020-12-11 03:23

    This is probably marked as a warning because people often use "=" by mistake when they mean "==".

    eg:

    $a = 1
    while($a = 1) {
       $a++;
    }
    

    This will never terminate, though if you thought you'd written "==", it should.

提交回复
热议问题