# Alternative PHP tags and strict_types=1

- Thread: https://staging.externals.io/message/86220
- Original archive: https://news-web.php.net/php.internals/86220
- Started by Bishop Bettini on 2015-05-14T14:39:12+00:00
- Messages: 2
- RFC: Remove alternative PHP tags (Implemented (PHP 7.0)) — https://staging.externals.io/rfc/remove_alternative_php_tags.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://staging.externals.io/search.md?q={query} · RFCs at https://staging.externals.io/rfc.md · JSON API at https://staging.externals.io/api · documentation at https://staging.externals.io/llms.txt

---

## #86220 — Bishop Bettini — 2015-05-14T14:39:12+00:00

URL: https://staging.externals.io/message/86220#86220

Hi!

In php7@20150501, I've noticed that this code <http://3v4l.org/hPFIg>
produces the expected output [1]:

<% echo 'top'; %>
<?php // COMMENTED OUT -- declare(strict_types=1);

But this code <http://3v4l.org/RriFV> unexpectedly produces the
strict-must-be-first instruction error:

<% echo 'top'; %>
<?php declare(strict_types=1);


Am I missing something?  I expected that removing the ASP tags
<https://wiki.php.net/rfc/remove_alternative_php_tags> from the language
would remove them and their contents from tallying as instructions.

Thanks,
bishop

[1]: The expected output is "<% echo 'top'; %>", not "top".

---

## #86221 — Albert Casademont — 2015-05-14T14:54:05+00:00

URL: https://staging.externals.io/message/86220#86221 · In reply to: #86220

mmm I guess this is the correct behaviour, <% tags ar now not parsed at all
and behave as plain text. If you run

http://3v4l.org/uDDW3

foo
<?php declare(strict_types=1);

it will fail too



> Hi!
>
> In php7@20150501, I've noticed that this code <http://3v4l.org/hPFIg>
> produces the expected output [1]:
>
> <% echo 'top'; %>
> <?php // COMMENTED OUT -- declare(strict_types=1);
>
> But this code <http://3v4l.org/RriFV> unexpectedly produces the
> strict-must-be-first instruction error:
>
> <% echo 'top'; %>
> <?php declare(strict_types=1);
>
>
> Am I missing something?  I expected that removing the ASP tags
> <https://wiki.php.net/rfc/remove_alternative_php_tags> from the language
> would remove them and their contents from tallying as instructions.
>
> Thanks,
> bishop
>
> [1]: The expected output is "<% echo 'top'; %>", not "top".
