Skip to content

undefined function error #760

Open
Open

Description

@bart-oski

Describe the bug

in php file, doing

require_once(__DIR__.'/../inc/functions.php');

causes undefined function in rest of file for functions.

Reproduction

changing it to

require_once('../inc/functions.php');

makes the warnings go away. after, if i change it back to

require_once(__DIR__.'/../inc/functions.php');

the warnings stay gone, even if i close the file and open it again

Expected behavior

No response

OS, Browser and Phoenix versions

windows 11
Release 5.5 build 5.5.11-23832
Phoenix Pro Build: d786c9f
build timestamp: 2026-10-27T11:04:30.905Z

logs or debug stack trace if any

Additional context

i seemed to notice this after fresh update from 5.1, doing the one off removal of DIR seemed to fix things in all files

Activity

  1. added
    bug
    on Oct 29, 2026
  2. devvaannsh commented on Oct 30, 2026

    @devvaannsh
    Member

    Hey @bart-oski, we added support for PHP code intelligence in the release version 5.2, so coming from 5.1 this is the first version where you're seeing all this checks. You can read more about PHP code intelligence here.

    Now coming to your issue, I checked this on our end and it's not actually related to __DIR__. The PHP code intelligence finds functions by looking at the PHP files inside the folder you have opened as the project, it doesn't follow the require path itself. Since ../inc/functions.php is one folder up, if inc is outside the folder you opened, those functions look "undefined" to it. The warnings most likely went away after your edit because you had functions.php open in a tab at that time (open files are also picked up), not because of the change itself.

    For now, open the parent folder (the one that contains both inc and your other files) as the project and the warnings should go away. Or alternatively, if you want you can also turn this PHP code intelligence feature. Refer to the doc linked above to read on how to disable it.

    Hope this helps! Also, we suggest raising issues here in this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions