shealtiel
shealtiel

Reputation: 8388

PHP: any exceptions to line commenting?

My code:

//  } elseif(php_uname() === TEST_SERVER_NAME){
//      $tmp = "/var/www/html/".preg_replace("/.*(demo[0-9]+).*/", '$1', $_SERVER['SERVER_NAME'])."/something/tmp/";
//  } else{
//      $tmp = '/var/www/html/something/tmp/';
//  }

My IDE (phstorm) highlights it as if something is not commented out, starting from the second line above. Is it the case? Can anything break line commenting?

Upvotes: 1

Views: 43

Answers (2)

Tim
Tim

Reputation: 14154

  • Maybe there's an open quote above which ends in your ' or "?
  • Maybe there's a /* above which ends in your */?
  • Maybe your IDE is wrong?

Upvotes: 1

deceze
deceze

Reputation: 522005

Everything following a // on a line is a comment until the end of the line. You can break out of /* */ comments, you cannot break out of // comments before the end of the line.

Your IDE is bad. ;)

Upvotes: 1

Related Questions