Check for runtime short_open_tags setting when running InvokePHPNativeSyntaxCheckPlugin
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- PHP
- Stars
- 5.6k
- Forks
- 365
- Avg merge
- 1h 25m
- Merged PRs (30d)
- 6
Description
The output of token_get_all can be used to determine the setting's value.
Unless you're building php from source and didn't turn it off, it's probably disabled.
Set -d short_open_tags=0 if the token type was T_INLINE_HTML
~ » php --no-php-ini -a -d short_open_tags=0
Interactive shell
php > var_export(token_get_all('<?phpinvalid'));
array (
0 =>
array (
0 => 379,
1 => '<?',
2 => 1,
),
1 =>
array (
0 => 319,
1 => 'phpinvalid',
2 => 1,
),
)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at InvokePHPNativeSyntaxCheckPlugin and run the provided token_get_all example to observe how short_open_tags changes tokenization. Update the plugin's runtime invocation to account for T_INLINE_HTML, then verify that native syntax checking handles the demonstrated setting correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100