Calculation Results for Postfix and Prefix Operators : Postfix Prefix Operators : Language Basics PHP Source Code


PHP Source Code » Language Basics » Postfix Prefix Operators »

 

Calculation Results for Postfix and Prefix Operators




<?
$count = 0;
$result = $count++;
print("Post ++: count is $count, result is $result<BR>");
$count = 0;
$result = ++$count;
print("Pre ++: count is $count, result is $result<BR>");
$count = 0;
$result = $count--;
print("Post --: count is $count, result is $result<BR>");
$count = 0;
$result = --$count;
print("Pre --: count is $count, result is $result<BR>");
?>
           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Language Basics
» Postfix Prefix Operators