ovi.ro

ovi.ro

Tag: operators

Operator Precedence

Like in math: 3 + 4 * 5 = 23 and not 35, in PHP you have an order for interpreting the code. AssociativityOperatorsAdditional Informationnon-associativeclone newclone and newleft[array()right++ — ~ (int) (float) (string) (array) (object) (bool) @types and increment/decrementnon-associativeinstanceoftypesright!logicalleft* / %arithmeticleft+ – .arithmetic ?i stringleft<< >>bitwisenon-associative< <= > >=comparisonnon-associative== != === … Read more »

Operators list

Arithmetic OperatorsExampleNameResult–$aNegationOpposite of $a.$a + $bAdditionSum of $a and $b.$a – $bSubtractionDifference of $a and $b.$a * $bMultiplicationProduct of $a and $b.$a / $bDivisionQuotient of $a and $b.$a % $bModulusRemainder of $a divided by $b.Assignment Operators<?php $a = 5; ?><?php $a = ($b = 2) + 5; // $a = 7 ?><?php $a = 2; $a += 3; // sets $a … Read more »