Last active
May 22, 2019 23:15
-
-
Save flaviors200/f2415a15146449472e7ce7401799459c to your computer and use it in GitHub Desktop.
Assignment operators
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 | |
$x = 30; | |
echo $x."\n"; // Output: 30 | |
$x += 30; | |
echo $x."\n"; // Output: 60 | |
$x -= 20; | |
echo $x."\n"; // Output: 40 | |
$x *= 3; | |
echo $x."\n"; // Output: 120 | |
$x /= 10; | |
echo $x."\n"; // Output: 12 | |
$x %= 5; | |
echo $x."\n"; // Output: 2 | |
$x **= 4; | |
echo $x."\n"; // Output: 16 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment