Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Mention new file extension possibility
  • Loading branch information
nikic committed Feb 19, 2020
commit 741340d51aebd66b3c5dd1897b4a0fb1af530c71
2 changes: 2 additions & 0 deletions rfcs/0000-language-evolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ Second, packages will very likely want to use one language dialect for the entir

A minor variation on the preceding variant: Instead of using declares, a new opening tag can be introduced. Once again this only works for P++ `<?p++` or editions `<?php2020`. This has essentially the same characteristics as per-file declares. It is slightly more compact, but introduces new syntax.
Comment thread
nikic marked this conversation as resolved.
Resolved

A suggestion that has been made during the discussion is that a new file extension could be used as well. This is only compatible with P++, otherwise all files in a project would have to be renamed on each edition upgrade. Using a file extension also has other disadvantages: It would not work in cases where the file extension is not known, for example if a script is piped into PHP, read from stdin, or coming from a non-filesystem stream. A new extension increases the chance of code-leaks on servers not aware of the new configuration.

## Namespace-scoped declares

This variant is explored in more detail in the [namespace-scoped declares](https://wiki.php.net/rfc/namespace_scoped_declares) RFC. This proposal allows specifying declares for a whole namespace (including sub-namespaces):
Expand Down