Skip to content

Instantly share code, notes, and snippets.

@maykonmeier
Created August 3, 2014 20:01
Show Gist options
  • Save maykonmeier/3cebe98856311462206d to your computer and use it in GitHub Desktop.
Save maykonmeier/3cebe98856311462206d to your computer and use it in GitHub Desktop.
Operadores de incremento/decremento
<?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