|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-04-10 19:34 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 23:00:01 2025 UTC |
('type of bug' may be wrong, just sounded right) When you comment ?> such as: //?> PHP sees it as the ending of a script. I _assume_ this is correctly done, since: <? phpinfo(); //blah?> is valid code. (unless i am wrong, and //?> is either supposed to be parsed as commented/invalid, then it's only another instance where the bug occurs :-) BUT, when commenting (with //) something that includes ?> ANYWHERE, it still ends the script (which i also _assume_ is wrong, becuase of the circumstances of the comment). Such as, in my case: preg_match('/<.*?>/',$file,$match); commented for testing purposes: //preg_match('/<.*?>/',$file,$match); The above (commented preg_match) will end the script, and everything below is treated as non-php and displayed to browser/stdout. This should NOT be happening, since regexp's (as an example) can potentialy contain this combination of characters (?>). I have tested it with these string, and the bug exists: Inside of text to be commented: //sd;lfksdl;fk;sdf?>sd;fkljskl;dfj Inside of a function to be commented: //preg_match('/<.*?>/',$file,$match); As the only item in a comment: //?> Now, using /* ?> */ (or any of the strings mentioned above) correctly is parsed as a comment. I have not checked other commenting methods (to tell you the truth, im not sure if there are more ways, these are the only two i ever use :-)