PHP plus: P++ proposal would create a stricter dialect

Posted on 15-08-2019 , by: admin , in , 0 Comments

A new dialect of PHP, code-named P++, could be developed as a stricter variant of its dynamic predecessor, with more advanced features and less baggage.

The proposal, being floated in the PHP community by PHP cofounder Zeev Suraski, would have P++, or whatever it is eventually called, living alongside PHP but not bound by PHP’s historical philosophy. P++ would not be a fork, but it would be inherently more strict and could be more daring with backward compatibility.

Elements now considered “baggage,” such as short tags, could be removed while complex features, especially ones for strictly typed languages such as strict operators or typed variables, could be added without introducing the same complexity to the PHP dialect.

Like PHP itself, P++ would predominantly be for server-side web development. The planned PHP 8 release already is expected to extend PHP beyond web development, with a just-in-time engine and interoperability with C/C++ libraries.

The vast majority of code in PHP and P++ would be identical. Most code would be shared between PHP and P++ nodes both in source and at runtime. But they would have different implementations. Binaries will be identical.

What is not clear yet is how a file would be marked as a P++ file. It would probably have a special header at the top. Builders also could find ways to mark entire namespaces as P++, so the frameworks do not have to mark each file as P++.