|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2013-06-16 22:29 UTC] stas@php.net
[2013-06-16 22:29 UTC] stas@php.net
-Status: Open
+Status: Closed
[2013-06-16 22:30 UTC] stas@php.net
[2014-10-07 23:18 UTC] stas@php.net
[2014-10-07 23:29 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 13:00:01 2025 UTC |
Description: ------------ The doc_comment compiler global is not reset when scanning of a new file/string starts. This leads to the last doc_comment seen by the tokenizer, but unclaimed by anything, being incorrectly assigned to the next thing the compiler sees. I think that the doc_comment and doc_comment_len globals should probably be saved/restored by zend_(save|restore)_lexical_state, and reset whenever scanning for a new file or string starts (pretty much everywhere zend_lineno gets initialised.) Test script: --------------- token_get_all("<?php\n/**\n * Foo\n */"); // doc_comment compiler global now contains this Foo comment eval("class Foo { }"); // Could also be an include of a file containing similar $rc = new ReflectionClass("Foo"); var_dump($rc->getDocComment()); // Foo shouldn't have a doc comment, and yet it does. Expected result: ---------------- bool(false) Actual result: -------------- string(14) "/**\n * Foo\n */"