autoformat (ctrl + alt + l) extra space before opening the php tag

<script>
function initAddress<?=$i?>_ <?=$j?>() {

}
</script>

What option is responsible for this space (before <?=$j?>)?

1
7 comments

Does space go away if you replace the shorthand tag with the actual printed value?

0
Avatar
Permanently deleted user
<script>
//all perfectly
initAddress<?=$i?>_<?=$j?>();

//bad space
function initAddress<?=$i?>_ <?=$j?>() {

}

//bad space
function initAddress <?=$i . "_" . $j?>() {

}

//all perfectly
function initAddress1_2() {

}

//bad space
function initAddress <? echo $i . "_" . $j?>() {

}

//bad space
function initAddress <?php echo $i . "_" . $j?>() {

}
</script>
0

Can't reproduce that in 2018.3.4. Please export your code style scheme and share it. Thank you!

0
Avatar
Permanently deleted user

<code_scheme name="MySuperScheme1">
<option name="RIGHT_MARGIN" value="500" />
</code_scheme>

phpStorm 2017.2.1

1. create file test.php

2. write to file:

<script>
function initAddress<?=$i."_".$j?>() {
}
</script>

3. press Ctrl + Alt + L

4. after that I see the result: 

<script>
function initAddress <?=$i . "_" . $j?>() {
}
</script>
0

It seems to be a bug, not an option. The bug is fixed in 2017.3.

Please upgrade.

0
Avatar
Permanently deleted user

thank you very much, I will try

0
Avatar
Permanently deleted user

installed PhpStorm 2019.1 EAP, everything is fine

1

Please sign in to leave a comment.