3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = 10; echo 'Value of $a is :'.$a; echo "\n"."After Pre-increment value of $a ( i.e. ++$a ) is: ".++$a; $a = 20; echo "\n"." Value of $a is :".$a; echo '<br />After Post-increment value of $a ( i.e. $a++ ) is: '.$a++; $a = 30; echo '<br />Value of $a is :'.$a; echo '<br />After Pre-decrement value of $a ( i.e. --$a ) is: '.--$a; $a = 40; echo '<br />Value of $a is :'.$a; echo '<br />After Post-decrement value of $a ( i.e. $a-- ) is: '.$a--; ?>
Output for 4.3.0 - 7.2.0
Value of $a is :10 After Pre-increment value of 10 ( i.e. ++10 ) is: 11 Value of 20 is :20<br />After Post-increment value of $a ( i.e. $a++ ) is: 20<br />Value of $a is :30<br />After Pre-decrement value of $a ( i.e. --$a ) is: 29<br />Value of $a is :40<br />After Post-decrement value of $a ( i.e. $a-- ) is: 40