Php program to print the pre decrement

A Php program to print the pre decrement. In this program we can print the number using pre decrement in php. The increment operator is used to increase the value by one, while the decrement operator is used to decrease the value by one. The increment operator reduces a value by one.

<?php
$x = 10;
echo --$x;
?>

 

Output:

9

What is pre decrement in Java

PHP supports pre- and post-increment and decrement operators in the C manner. Only numbers and strings are affected by the increment/decrement operators. The symbol ‘—’ stands for the decrement operator.

Both prefix and postfix notations are supported by the decrement operator. The value of a variable is utilised in the expression after it has been decremented in prefix notation. Pre-increment means that the value is increased by one before being assigned to the variable.