Skip to content

Symbol discovery does not find functions returning references #3829

@MCMic

Description

@MCMic

Bug report

I get this error:

 ------ -------------------------------------------------------------------- 
  Line   include/class_msg_dialog.inc                                        
 ------ -------------------------------------------------------------------- 
  197    Function get_smarty not found.                                      
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols  
 ------ -------------------------------------------------------------------- 

The function get_smarty is in another file and looks like this:

function &get_smarty ()
{
  global $smarty;

  return $smarty;
}

The discovery of other functions and symbols works fine, and if I remove the & the error goes away so I think the symbol discovery has a bug related to function returning by reference.

Code snippet that reproduces the problem

Expected output

No error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions