Multiple choice php

What is the problem with =$expression ?> ?

  1. It requires short tags and this is not compatible with XML

  2. There is no problem

  3. This syntax doesn't even exist It requires a special PHP library that may not always be available

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The short echo syntax =$expression ?> requires short_open_tag to be enabled in php.ini. This conflicts with XML declarations which also start with . Since PHP 5.4, short echo tags are always available regardless of short_open_tag setting, but full short tags ?> still conflict with XML and are discouraged for portable code.

AI explanation

The short echo tag = $expression ?> is a shorthand form of `, and it only works when theshort_open_tagsetting is enabled on the server — it's not guaranteed to be available everywhere. Historically this shorthand also conflicted with XML processing instructions, since...?>` is the same syntax XML uses for its own processing instructions, causing parser confusion in XML-embedded contexts. That's why relying on it is considered a portability/compatibility problem rather than a safe default.