Bug #81269 [Fbk->NoF]: getDocComment is not working correctly

From: Date: Sun, 01 Aug 2021 04:22:19 +0000
Subject: Bug #81269 [Fbk->NoF]: getDocComment is not working correctly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235510@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81269&edit=1

 ID:               81269
 Updated by:       php-bugs@lists.php.net
 Reported by:      popov654 at yandex dot ru
 Summary:          getDocComment is not working correctly
-Status:           Feedback
+Status:           No Feedback
 Type:             Bug
 Package:          Reflection related
 Operating System: Windows 7 x64 Pro
 PHP Version:      8.0.8
 Assigned To:      cmb
 Private report:   N

 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.


Previous Comments:
------------------------------------------------------------------------
[2021-07-19 09:25:36] cmb@php.net

> I set save_comments to 0, that was the reason of stripping this
> out.

Right.  And when you change the setting, you need to restart
Apache for that change to be effective.  However, depending on
other INI directives, the code may still be read from the file
cache, what's likely what has happened to you.

> But the behavior of that option has changed since 7.4 anyway (it
> ignored PHPdoc before?).

opcache.save_comments is only about doc block comments (i.e. those
starting with /**); other comments are always stripped.

------------------------------------------------------------------------
[2021-07-19 08:03:23] nikic@php.net

For me the comment is always missing with save_comments=0, regardless of how it looks like. That
also matches the implementation.

I suspect that the behavior you observed might be an artifact of having options like
opcache.file_update_protection enabled. If it's enabled and you access a file quickly after
modifying it, then it will not be cached and save_comments=0 will not take effect.

------------------------------------------------------------------------
[2021-07-19 00:21:19] popov654 at yandex dot ru

Ah, I got it. That was my fault with wrong configuration of opcache. I set save_comments to 0, that
was the reason of stripping this out.

But the behavior of that option has changed since 7.4 anyway (it ignored PHPdoc before?). Also I
don't understand why the comment is not stripped when the first line of PHPdoc contains just
one word.

Maybe that needs a fix?

------------------------------------------------------------------------
[2021-07-18 23:45:22] popov654 at yandex dot ru

OK, here is some more testing.

1. It is in fact bool(false) as you said
2. I enabled opcache log with level 4, and here is the output:

Mon Jul 19 02:39:30 2021 (9636): Message Cached script 'D:\xmessenger\bug.php'
Mon Jul 19 02:39:30 2021 (9636): Message Added key 'D:/xmessenger/bug.php'

No errors as you see.

3. Without opcache enabled it is really behaving correctly.


But still I consider this to be a bug. Have you tested with opcache extension on yourself? What is
your Windows version where you test?

I really need opcache for better performance on versions PHP from 5.4 and newer (though my PC is not
as terrible, the HDD disk performance is too bad even for lightweight PHP applications on PHP
versions 5.4+).

Btw, I can check it on Win 10 x64 with latest updates if you want.

------------------------------------------------------------------------
[2021-07-18 11:25:46] cmb@php.net

I cannot reproduce the reported behavior.

Does this also happen when OPcache is disabled?  Does
::getDocComment() really return an empty string, or maybe false
(use var_dump() instead of echo).  Does the OPcache error log (you
may need to set opcache.error_log and should set
opcache.log_verbosity_level=4) give any hints?

------------------------------------------------------------------------


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

    https://bugs.php.net/bug.php?id=81269


--
Edit this bug report at https://bugs.php.net/bug.php?id=81269&edit=1


Thread (1 message)

  • php-bugs at lists dot php dot net
  • Unknown Message
    • php-bugs at lists dot php dot net
« previous php.bugs (#235510) next »