PHP ain't dead and it's like good wine, getting better every year. In this talk we'll go through what's new in PHP7, and how its new engine stands next to HHVM, while highlighting new syntax goodies.
5.3 onwards… the others are rubbish anyways... 5.3 the biggest leap 5.4 array shorthands, traits and a webserver! 5.5 generators (i yield!) and expressions in primitives 5.6 constant expressions, …$params notation 5.7 when everybody went bananas! long wait.... 7.0 major shift
logically code separation late static binding for static inheritance closures don’t we just love to provide functions as arguments! nowdoc & heredoc output buffered content constants immutable data FTW! shorthand ternary ?: ‘hello’; dynamic access to static $a::$b \m/
class decoration array short syntax no more array(‘a’ => ‘b’) function array deref hello()[0] closures can have a scope short open tags for echoing always available instantiating access (new ABC)->a()->b()->c() Class::{expressions} awesome! binary is now available session track for upload hooray progress bars webserver aleluia!
results from the same function finally who haven’t discard an exception before primitives accept functions such as foreach empty() accepts expressions, like functions dereferencing for arrays and strings ::class for dynamic class name access OPcache for precompiled code storage
sometimes constants are not just constants const arrays heheh told ya! ... Rest params via array! Awesome! ...$params and spreading exponentiation right to left, never forget! use syntax for functions and constants via namespaces Class::__debugInfo for class var_dump
function arguments more types for return declarations null or bust isset($a) ? $a : ‘a’ = $a ?? ‘a’ spaceship op echo -1 <=> 1 good ol’define for arrays anonymous classes fire and forget! Closure::call() hello late closure calls assert() expectations, finally! use just got javascript’d use \some\{A,B,C}
before announcing the 6th version, which made facebook develop its own virtual machine HHVM is a JIT compiler to bytecode and virtual machine that runs that bytecode