-1
$x = 5 /* + 15 */ + 7;
echo $x;

The output of this code is 12. Can anybody explain me how this works?

Patrick
  • 331
  • 3
  • 18

1 Answers1

1

The middle part is a comment, so everything between /* and */ will be ignored. So 5+7=12 which is correct :)