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

From: Date: Sun, 18 Jul 2021 23:45:22 +0000
Subject: Bug #81269 [Fbk->Asn]: getDocComment is not working correctly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235150@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
 User updated by:    popov654 at yandex dot ru
 Reported by:        popov654 at yandex dot ru
 Summary:            getDocComment is not working correctly
-Status:             Feedback
+Status:             Assigned
 Type:               Bug
 Package:            Reflection related
 Operating System:   Windows 7 x64 Pro
 PHP Version:        8.0.8
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[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?

------------------------------------------------------------------------
[2021-07-17 12:51:41] popov654 at yandex dot ru

extension=curl
extension=mbstring
extension=exif
extension=mysqli
extension=openssl
extension=pdo_mysql

zend_extension=opcache

Just this set. It is also the same as in 7.2 and 7.4

------------------------------------------------------------------------
[2021-07-16 21:13:02] requinix@php.net

What PHP extensions do you have enabled through Apache? Especially interested in anything that
caches or "optimizes" code.

------------------------------------------------------------------------
[2021-07-16 21:07:06] popov654 at yandex dot ru

Version of Apache on Windows is 2.4.48 x64, it is also the latest one.

------------------------------------------------------------------------
[2021-07-16 21:02:30] popov654 at yandex dot ru

Description:
------------
If PHP is configured as an Apache module, the returned value is an empty string.

However, if you remove the space in the second line ("Thetest"), the output is correct. If
you replace the space with an underscore ("_"), it still fails.

If PHP is run through the command line, the output is correct.

Also on Ubuntu 20.10 with latest Apache and PHP 8.0.8 the result is correct. So I guess it is
somehow related with the Apache module for Windows.

Test script:
---------------
<?php

/**
* The test
*
* @param  foo bar
* @return baz
*/
class TestClass {

}

$class = new ReflectionClass('TestClass');

print_r($class);
echo $class->getDocComment();

?>

Expected result:
----------------
/**
* The test
*
* @param  foo bar
* @return baz
*/



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



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


Thread (1 message)

  • popov654 at yandex dot ru
  • Unknown Message
    • popov654 at yandex dot ru
« previous php.bugs (#235150) next »