Posted by: Md. Masud on: May 24, 2007
I have found a code of php like that. what is the Output of this code?
<?php
$x = 0;
echo -$x;
?>
Answer: -1
But i want to know why and how?????
with regards masud
1 | nilesh September 2, 2007 at 7:39 am
simple , if it was -$x the its as 0-1 = -1, so
try echo -$x + 1; will be 0
Your Name (required)
Your Email (required)
Your URL
Notify me of follow-up comments via email.
September 2, 2007 at 7:39 am
simple , if it was -$x the its as 0-1 = -1, so
try echo -$x + 1; will be 0