PHP 7

PHP 7 Crash Course

Lone Star PHP 2016

PHP 7 was recently released, bringing some much-desired changes and improvements to the language. However, many developers haven't had the opportunity to use it for their projects and may not be familiar with the changes it brings. We'll remedy this by checking out the new "spaceship operator," demonstrating how static type hints produce clean code, and using anonymous classes to quickly implement interfaces on the fly. Attendees will also learn about breaking changes and "gotchas" to watch out for when making the upgrade and will receive pointers on getting started with PHP 7 today.

 

With the imminent release of PHP 7 on the horizon, I thought it would be cool to check out some of the lesser-known features coming with the 7.0.0 release:

1. Array constants in define()

PHP 5.6 added the ability to define array constants on classes by using the const keyword:

const LUCKY_NUMBERS = [4, 8, 15, 16, 23, 42];

PHP 7 brings this same functionality to the define() function:

 

PHP 7 Crash Course

php[world] 2015

The PHP 7 release is just around the corner, bringing some much-desired changes and improvements to the language. However, many developers simply aren't aware of what's coming. We'll remedy this by checking out the new "spaceship operator," demonstrating how static type hints produce clean code, and using anonymous classes to quickly implement interfaces on the fly. Attendees will also learn about breaking changes and "gotchas" to watch out for when making the upgrade and will receive pointers on getting started with PHP 7 today.