Jump to content

4+9=49?


Recommended Posts

What liuyang was showing is that you have the order wrong. The equals (assigment) operator is a right-to-left operator. So, everything on the right side of the operator gets evaluated, and stored to whatever is on the left side. So, with this statement:$var = 1 + 2 + (3 * 4 * (5 / 6) * 7) + 8;Everything on the right side of the equals (the equation) gets evaluated first, and then assigned to what is on the left side of the equals (the variable). So, if you want to add $var1 and $var2 and store the result in $var3, it is written like this:$var3 = $var1 + $var2;

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...