Why is the condition not working? Unless variables cannot be added? (phpstorm swears)

enter image description here

Closed due to the fact that off-topic participants Alexey Shimansky , andreymal , tutankhamun , aleksandr barakin , Dmitriy Simushev 26 May '17 at 10:36 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Alexey Shimansky, andreymal, tutankhamun, aleksandr barakin, Dmitriy Simushev
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 2
    1. <del> Handling </ del> add 2. In if wrong condition is tutankhamun
  • @ Eugene because because you add string variables, not numeric ones. Write the assignment without apostrophes: $ a = 20; $ b = 10; And you also have an error in the condition - the comparison operator is written like this: == (two characters equals) - Edward
  • @ Edward Right, thanks) - Eugene
  • four
    Do not lay out the code pictures. Spit it out with text ! - Alexey Shimansky
  • @ Alexey Shimansky good - Eugene

1 answer 1

You wrote in if not comparison == and assignment = .

 if($operators == '+') 
  • The author has already been informed about this in the first comment - Edward
  • one
    @ Edward, I already see. I just looked that there are no answers. - Abmin
  • @Abmin because such questions are closed as "The question is caused by a problem that is no longer reproduced, or a typo" and there is no answer in them - Alexey Shimansky
  • @ Alexey Shimansky, I'll know now. Do I delete the answer? - Abmin
  • Yes, leave, can anyone plyusanet) - Alexey Shimansky