---
title: "format/tags/echo-syntax"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

<RuleId id="format/tags/echo-syntax" />

Not in any preset. Safe fix.

## What it does

Replaces short-echo `<?=` with long format `<?php echo`/`<?php print` syntax, or vice-versa.

## Configuration

```toml title="pun.toml"
[format.rules]
"tags/echo-syntax" = true
```

To skip it in some files, add a [`@pun-ignore-file`](/docs/configuration/ignore-comments) comment.

## Options

| Name | Type | Allowed values | Default | Upstream name |
| --- | --- | --- | --- | --- |
| `format` | `enum` | `long`, `short` | `"long"` | `format` |
| `long-function` | `enum` | `echo`, `print` | `"echo"` | `long_function` |
| `shorten-simple-statements-only` | `bool` | Any | `true` | `shorten_simple_statements_only` |

## Replaces

- [`echo_tag_syntax`](https://cs.symfony.com/doc/rules/php_tag/echo_tag_syntax.html) (php-cs-fixer)

[More format/tags rules](/docs/rules/format/tags) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
