Created
April 23, 2017 03:22
-
-
Save geekcom/9a0179acabed83b595efb3b1ed1809f5 to your computer and use it in GitHub Desktop.
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 | |
echo "<h3>Pós-incremento</h3>"; | |
$a = 5; | |
echo "Deve ser 5: " . $a++ . "<br>\n"; | |
echo "Deve ser 6: " . $a . "<br>\n"; | |
echo "<h3>Pré-incremento</h3>"; | |
$a = 5; | |
echo "Deve ser 6: " . ++$a . "<br>\n"; | |
echo "Deve ser 6: " . $a . "<br>\n"; | |
echo "<h3>Pós-decremento</h3>"; | |
$a = 5; | |
echo "Deve ser 5: " . $a-- . "<br>\n"; | |
echo "Deve ser 4: " . $a . "<br>\n"; | |
echo "<h3>Pré-decremento</h3>"; | |
$a = 5; | |
echo "Deve ser 4: " . --$a . "<br>\n"; | |
echo "Deve ser 4: " . $a . "<br>\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment