bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code

Home Page:https://intelephense.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

intelephense(P1010)

SourabhChatterjee opened this issue · comments

Describe the bug
in vs code when a function called from other php file (after properly included the file) it's showing red underline in my function, on hover it's showing "Undefined function 'myFunction'.intelephense(P1010)", however when I called myFunction from current php file ( where I included the file path and geting red under line with issue "Undefined function 'myFunction'.intelephense(P1010)") myFuntion working perfectly and returning values as expected.

I tried to reset extension, vs code, but no luck.

To Reproduce


pageInfo.php

'localhost', 'username' => 'sayakengineering', 'password' => 'Sayak!Eng@9836', 'database' => 'sayakengineering', 'userTable' => 'sec_user' ); ************************************************************************************************************** sec_dbHandler.php connect_error) { return array("status" => "error", "error" => $conn->connect_error); } // Hash the password $user_pass_hashed = md5($user_pass); // If already Hash the password //$user_pass_hashed = $user_pass; // Prepare SQL query $sql = "SELECT * FROM " . $sec_db_config['userTable'] . " WHERE user_id = ? AND user_pass = ?"; // Prepare and bind parameters $stmt = $conn->prepare($sql); // Check if prepare() succeeded if ($stmt === false) { die("Error preparing SQL query: " . $conn->error); } // Bind parameters $stmt->bind_param("ss", $user_id, $user_pass_hashed); // Execute query $stmt->execute(); // Get result $result = $stmt->get_result(); // Check if a row is found if ($result->num_rows > 0) { // Fetch the row $row = $result->fetch_assoc(); $stmt->close(); $conn->close(); return array("status" => "ok", "token" => $row['log_token'], "logTime" => $row['log_time']); } else { // No matching row found $stmt->close(); $conn->close(); return array("status" => "notfound", "token" => null, "logTime" => null); } } ***************************************************************************************************************** finaly test.php from where I am exicuting and geting red under line with error "Undefined function 'validateUserSEC' .intelephense(P1010)" "; echo "Log Time: " . $response['logTime']; } elseif ($response['status'] === "notfound") { echo "No matching user found."; } else { echo "Error: " . $response['error']; } ******************************************************************************************************** when I am excuting test.php it's returning as expected even that error still there **Expected behavior** I expected it shold not marke as issue, if I disable extension there is no issue **Screenshots** ![Screenshot 2024-04-23 002317](https://github.com/bmewburn/vscode-intelephense/assets/54030720/19630ee4-ca67-4675-94f3-a705ad688d78) If applicable, add screenshots to help explain your problem. **Platform and version** OS and Intelephense version.

Intelephense will only search for and index unopened files when a folder is opened in vscode.