How to execute html code inside php?

I wouldn’t recommend writing PHP code in the content this way, e.g. for security reasons.

Most likely the shortcode is using eval() and you need a valid PHP code snippet in each such call.

The PHP documentation has this warning:

Caution The eval() language construct is very dangerous because it
allows execution of arbitrary PHP code. Its use thus is discouraged.
If you have carefully verified that there is no other option than to
use this construct, pay special attention not to pass any user
provided data into it without properly validating it beforehand.

You should consider writing your own shortcode instead, keeping the PHP code away from the users and the content editor.