Paul Krill
Editor at Large

PHP gets its own formal language specification

analysis
Jul 31, 20142 mins

PHP scripting language, a critical cog in Web development, codifies its semantics and syntax to minimize divergence

Although the PHP scripting language has been around since 1995 and is a staple of Web development, it does not actually have a formal language specification — just extensive user documentation. But that is all set to change.

Led by Facebook, a draft specification has been posted on GitHub to provide a complete definition of PHP language semantics and syntax.

“The next major version of PHP — PHP7 — is in the works, and in order to ensure full compliance with existing PHP scripts it’s important to know what is expected from the engine,” said Facebook’s Sara Golemon, who participated in the development of the specification. “Additionally, with alternative implementations like HHVM coming on the scene, it’s important to keep divergence to a minimum, again by understanding what a well-behaved engine looks like.”

The PHP Group, which includes PHP founder Rasmus Lerdorf as well as Andi Gutmans, CEO of tools vendor Zend Technologies, is overseeing the specification. The group also conducts the php.net website, the principal site for PHP’s development. Making changes to the specification will require a php.net account.

Facebook’s HHVM, formerly known as HipHop Virtual Machine, was built with the intention of making PHP run fast. The planned specification will make sure HVVM is a fully compatible implementation for PHP, Golemon said. “For example, the conformance suite we released along with the spec shows HHVM failing a number of edge cases.  By having that signal, we can bring HHVM more in line with PHP.”

Next up for the specification are improving wording, correcting edge cases, and boosting the conformance suite. “In the long term, this document will be developed alongside the PHP implementation to document new syntax in a formal manner, such as the recent addition of the pow operator, variadics, and splat,” Golemon said.

Developers involved with the language have been working on improvements to boost real-world application performance. In the lab, these changes have resulted in decreased memory usage as fewer machine instructions are necessary to execute an application.

This story, “PHP gets its own formal language specification,” was originally published at InfoWorld.com. Get the first word on what the important tech news really means with the InfoWorld Tech Watch blog. For the latest developments in business technology news, follow InfoWorld.com on Twitter.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author