Hi,

Found this issue related to the reference counter for constant:

<?php
    declare(strict_types=1);

    namespace Devsense\Builtin;

    final class TestA
    {
        /**
         * Should have 1 reference
         * @var string
         */
        public const string MY_CONST = 'abc';
    }

    $testA = new TestA();
    echo $testA::MY_CONST;

Note: It is maybe related to this ticket https://community.devsense.com/d/2063-reference-between-trait-and-class-does-not-work

Thank you for your fix.

Regards,

    Jean-FrancoisHIVERT Thank you for reporting the issue.

    It seems it does not like dynamic constant access.

    echo TestA::MY_CONST;

    works ok though. Will be fixed!

      It seems this was intentional (a few years ago) so the reference counting won't be slowing down the editor; however, after some optimisations it won't be an issue anymore.

      6 days later

      Implemented. We will check if it's not causing any performance issues and release it the next update.

        a month later

        @JakubMisek Hi, if it is good for your, I mean without any performance impact, maybe we can close this issue/ticket?

          Write a Reply...