[php-src] Issue #7993: php open/close tags ignored within C-style comments

From: Date: Sun, 23 Jan 2022 15:25:26 +0000
Subject: [php-src] Issue #7993: php open/close tags ignored within C-style comments
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-239252@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/7993 Comment Author: Daniel-Peder > It will do the exactly same thing with strings or heredocs and this is how it was designed to > do. Even If this would work as you're expecting it to do, you would get syntax error for > unclosed comment. > > The only exception are single-line comments, as documented: > > > The "one-line" comment styles only comment to the end of the line or the current > > block of PHP code, whichever comes first. This means that HTML code after // ... ?> or # ... > > ?> WILL be printed: ?> breaks out of PHP mode and returns to HTML mode, and // or # cannot > > influence that. > > > > https://www.php.net/manual/en/language.basic-syntax.comments.php 1/ You are talking about one-line comments 2/ the behaviour is poorly documented 3/ the open/close tags should behave as described, ie stop interpetting the php code. Comments are part of php code but the open/close tags did not stopped to interpret it.

« previous php.bugs (#239252) next »