0

I ran into this when I was just trying to echo out some data. Any idea why PHP acts like this?

Code:

for($i = 0; $i < 10; $i++){
   echo "NO parenthesis : " . $i+1 . "\n";
   echo "WITH parenthesis : " . ($i+1) . "\n";
}

output:

1
WITH parenthesis : 1
1
WITH parenthesis : 2
1
WITH parenthesis : 3
1
WITH parenthesis : 4
1
WITH parenthesis : 5
1
WITH parenthesis : 6
1
WITH parenthesis : 7
1
WITH parenthesis : 8
1
WITH parenthesis : 9
1
WITH parenthesis : 10
Rizier123
  • 58,877
  • 16
  • 101
  • 156
Mark Manning
  • 1,427
  • 12
  • 14

0 Answers0