Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Increment
- $a = 5;
- $a++; // sama dengan $a = $a + 1;
- echo $a; // Output: 6
- // Decrement
- $b = 8;
- $b--; // sama dengan $b = $b - 1;
- echo $b; // Output: 7
- // Prefix Increment
- $c = 10;
- echo ++$c; // Output: 11
- // Prefix Decrement
- $d = 7;
- echo --$d; // Output: 6
- // Postfix Increment
- $e = 4;
- echo $e++; // Output: 4
- echo $e; // Output: 5
- // Postfix Decrement
- $f = 9;
- echo $f--; // Output: 9
- echo $f; // Output: 8
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement