Unary operators increment or decrement values instantly. These operators are frequently used in For loops, which are described later in this chapter:
# Initialize variable
$a = 1
# Increment after
$a++ # 2
# Decrement after
$a-- # 1
# Increment before
++$a # 2
# Decrement before
--$a # 1