Created
August 3, 2014 20:01
-
-
Save maykonmeier/3cebe98856311462206d to your computer and use it in GitHub Desktop.
Operadores de incremento/decremento
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$a = 10; | |
// ++ após a variável, executa a operação de incremento após a expressão | |
// Nesse caso, $c será 10 e $a será 11; | |
$c = $a++; | |
// Agora, $d e $a serão iguais, ambos terão o valor 12 | |
$d = ++$a; | |
// Do mesmo modo os operadores de decremento |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment