ID: 26629
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Bogus
Bug Type: Strings related
PHP Version: 4.3.4
New Comment:
Because the lexer in PHP handles those cases different.
"$a\n" = quote + variable + newline character + quote
"a\n" = string
Try this script:
<pre>
<?php
highlight_string('<?php "a\n"; ?>');
var_dump(token_get_all('<?php "a\n"; ?>'));
highlight_string('<?php "$a\n"; ?>');
var_dump(token_get_all('<?php "$a\n"; ?>'));
?>
</pre>
(and leave this bug bogus)
Previous Comments:
------------------------------------------------------------------------
[2003-12-17 03:51:38] [EMAIL PROTECTED]
Tell me a reason why \n should be highlighted as keyword in "$a\n" and
in "a\n" not.
------------------------------------------------------------------------
[2003-12-16 17:11:51] [EMAIL PROTECTED]
You're wrong. The current behavior is correct.
------------------------------------------------------------------------
[2003-12-16 17:01:57] [EMAIL PROTECTED]
I don't know what "1 string" is. Is "$a\n" also "1 string"? If it is,
there should not be \n highlighted in it.
The problem is that in "$a\n" is \n highlighted and in "a\n" isn't. I
believe that it should be consistent.
------------------------------------------------------------------------
[2003-12-16 12:22:20] [EMAIL PROTECTED]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
This is how it supposed to work, "a\n" is 1 string.
------------------------------------------------------------------------
[2003-12-16 12:08:14] [EMAIL PROTECTED]
Sorry for mismatch. The bug report is for PHP 4. I looked for
highlighting code and I found it in /ZendEngine2 but I didn't realized
that this code is for PHP 5 only. I don't know where this part of code
for PHP 4 is. Just ignore the sentence in bracket, the provided version
information is correct.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/26629
--
Edit this bug report at http://bugs.php.net/?id=26629&edit=1