How to comment a string containing */

comments, php, syntax-error

Solution

use `"*/*/*/*/*.gif"` slashes as `DIRECTORY_SEPARATOR` constant?

$path = FOLDER . '*' . DIRECTORY_SEPARATOR . '*' . DIRECTORY_SEPARATOR  . '.gif';

You can make a shortcut like `define('DS', DIRECTORY_SEPARATOR);`

Problem

I have a line of PHP source code I would like to keep in a PHP file as a comment, so it can be used when necessary. This is only a debugging script, so keeping the file clean is not an issue. Nevertheless, I am trying to comment these lines using `/*` and `*/`: ``` /* $path = FOLDER . "*/*/*/*/*.gif"; $files = glob($path); */ ``` But this result in a parse error, because the path `*/*/*/` closes the comment block. An opening `/*` won't be treated as an opening comment inside a string, but since the commented code is not parsed, the `*/` is treated as a closing comment. Can anyone can think of a workaround without using `//`?

Original source