PROGRAMMING     CLIMBING

  minte9
reminder




Last update:   22-02-2022

Increment

If the operator is placed after its operand, the interpreter will first return the value.
 
/**
 * If the operator is placed after its operand, 
 * the interpreter will first return the value.
 * 
 * Incrementing or decrementing booleans has no effect.
 */

$a = 1;
echo $a++; // 1

$a = 1;
echo ++$a; // 2

$a = TRUE;
echo ++$a; // 1

Chars

Arithmetics on chars follows Perl's convention.
 
/**
 * Arithmetics on chars follows Perl's convention.
 */

$i = 'W';
for ($n=0; $n<6; $n++) {
    echo ++$i . " "; // X Y Z AA AB AC 
}

Questions     github Operators
Bitwise
        A B C D E F
🔔
1/4