Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad suggested array key name in compile time constants #251

Open
litdevel opened this issue Aug 11, 2023 · 0 comments
Open

Bad suggested array key name in compile time constants #251

litdevel opened this issue Aug 11, 2023 · 0 comments
Labels

Comments

@litdevel
Copy link

Describe the bug
Bad suggested array key name in compile time constants

Describe the eclipse environment
Eclipse PDT 8.1.0.202307051059

To Reproduce
Steps to reproduce the behavior:

  1. Copy this code
<?php

const TEST_CONSTANT = [
    'HT_aa_very_long_long_long_key' => 1,
    'HT_ab_very_long_long_long_key' => 2,
    'HT_ac_very_long_long_long_key' => 3
];

TEST_CONSTANT['H'];

$_SERVER['HTTP_ACCEPT'];

$runtime_test_array = [
    'HT_runtime_key1_verylong' => 'value1',
    'HT_runtime_key2_verylong' => 'value2',
    'HT_runtime_key3_verylong' => 'value3',
];

$runtime_test_array['HT'];

  1. Move cursor to "['H']" after H on line 9, press Ctrl + Tab
  2. Read suggestions

Expected behavior
Constant "TEST_CONSTANT" array keys 'HT_aa_very_long_long_long_key', 'HT_ab_very_long_long_long_key' and 'HT_ac_very_long_long_long_key' must be suggested. Other array keys from $runtime_test_array or $_SERVER must not be suggested.

Screenshots

screen_1
screen_2

@litdevel litdevel added the bug label Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant