This is strange, other users already confirmed that this format of definition worked for them correctly on Php 8.1+
Can you please double-check the version?
The issue is that the format you're mentioning as working is different than the Annotation format. Currently export shares the same base logic for annotations and attributes and we can't simply switch it to the
#[ORM\Index] format without breaking annotations.