|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-11-28 08:24 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 03:00:01 2025 UTC |
Description: ------------ Any slash style comment (//) that ends with ?> will produce a parse error. With /* */ style comments, this does not happen. Have not tested with # style comments. Reproduce code: --------------- <?php //this line ends with ?> echo 'hello'; ?> and <?php class test { //this comment ends with ?> public function hello() { echo 'hello'; } } $test = new test(); $test->hello(); ?> Expected result: ---------------- I expect both examples to echo the word "hello". Actual result: -------------- First example: "echo 'hello'; ?>" is printed to the screen. Second example: Parse error: syntax error, unexpected ';', expecting T_FUNCTION in C:\Apache2\Apache2\htdocs\crap\bug.php on line 5 On a real-world example where I encounted the problem, I got a Parse error: unexpected $end So the errors vary.