Jump to content

What PHP setting will remove this feature?


avmvldr

Recommended Posts

In the attached image, please see the "IF" statment and it' conditions. Notice the grayed values "password:" and "hash:", which you can't delete because they're not really there. I'm using version 8.3.10 of PHP which I believe is the latest version. How do I remove this feature?

Thanks,
Blake

Screenshot.jpg

Link to comment
Share on other sites

Not sure of a "Setting" in PHP as such but try this:

if (password_verify($password, $hashedPassword)) {
    $_SESSION['user_id'] = $user['id'];
    $_SESSION['handle'] = $user['user_handle'];
    echo "Login successful! Welcome, " . htmlspecialchars($username) . ".";
} else {
    echo "Invalid username or password.";
}

I removed Named Parameters: The password_verify function does not support named parameters in PHP. Therefore, I removed the 'password:' syntax to ensure the code runs correctly.

Link to comment
Share on other sites

38 minutes ago, gizmola said:

Not sure why you would want to disable the hinting feature,

It might work a little more cleanly in PHPStorm, but when I tried it in VS Code, I found it much more complicated to try to select text or read through code when the editor was injecting those things into the view. Maybe if they weren't inline, though I can't imagine how not, they might be nicer for me...

But I'm also a proponent of the idea that you should be able to tell what the parameter is, be that through a variable name or an obvious literal value (or a constant...), and if you can't tell then you should do something about that.

// this is obvious on what the parameters are
password_verify($password, $hashedPassword)

// this is not
password_verify($value, $row[1])

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

I don't remember if Intelephense provided the feature or not. In fact I might not even have tried it with PHP - maybe it was another language. But I assume the concept works the same way everywhere.

But yeah, the hover or autocomplete list has always been sufficient for me. Oh well, whatever works best for each person.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.