5.6 IS PRACTICALLY ON LIFE SUPPORT AND PROJECTS ARE DROPPING IT The force is weak with those who think that “*” is a version constraint. twitter.com/tobySen/status… 7:27 PM 5 Feb 2017 · Oberding, Deutschland 21 43 Sebastian Bergmann @s_bergmann Follow Laravel 5.5 in July 2017 will require PHP 7+ 4:29 PM 16 Dec 2016 419 808 Taylor Otwell @taylorotwell Follow #Symfony 4 (to released in November 2017) will drop #PHP 5 support... So, #Twig 2 stable should probably supports PHP 7 only, right? 2:54 PM 16 Dec 2016 264 383 Fabien Potencier @fabpot Follow For the future 2.6 release I will drop support for PHP < 7.0 to massively simplify code. Should I keep support for PHP 5? 1:22 PM 13 Dec 2016 · City of London, London 39 12 Xdebug @xdebug Follow
SUPPORT Ubuntu 16.04 and up Available via third parties on most Linux distros Available on the better shared and wp speci c providers: SiteGround, WP Engine, Bluehost, Superhosting, ICN WordPress.com runs PHP7
VOID RETURN TYPE But you can still `return` to break execution function init_save() : void { if($someCondition) { return; } add_action('save_post', 'my_custom_callback'); }
ITERABLE PSEUDO-TYPE Same result with any construct you can iterate over $array = ['item 1', 'item 2', 'item 3']; $collection = new class implements Iterator { ... }; function gen() { yield 'item 1'; yield 'item 2'; yield 'item 3'; } iterateStruct($array); iterateStruct($collection); iterateStruct(gen());
CLASS CONSTANT VISIBILITY Declare private, protected and public constants class SpecialConfig { private const MY_VALUE = 'value'; public function doStuff() { echo self::MY_VALUE; } } $special = new SpecialConfig(); $special>doStuff(); // prints 'value' echo SpecialConfig::MY_VALUE; // throws error
CATCHING MULTIPLE EXCEPTIONS Without the new thingy try { // Do stuff and throw exception } catch (OneException $e) { // do stuff with $e } catch (TwoException $e) { // copypaste the same code from above }
CLOSURE::FROMCALLABLE() Create closures from callable pseudo-type // Without the new method function filter_func() {} add_filter('example_filter', 'filter_func'); // With the new syntax add_filter('example_filter', Closure::fromCallable('filter_func')); // Throws Error add_filter('example_filter', Closure::fromCallable('callback_wrong_name
CLOSURE::FROMCALLABLE() You can use class methods too class FooPlugin () { public function init() { add_filter( 'example_filter', Closure::fromCallable([$this, 'exampleFilterMethod'] ); } private function exampleFilterMethod() {} } (new FooPlugin)>init();
WHAT DO WE KNOW? No release date yet - probably in December again A bunch of things are deprecated New password hashing algorithm in core Libsodium will be in core
LIBSODIUM From the RFC Libsodium is a modern cryptography library that offers authenticated encryption, high-speed elliptic curve cryptography, and much more. Unlike other cryptography standards (which are a potluck of cryptography primitives; i.e. WebCrypto), libsodium is comprised of carefully selected algorithms implemented by security experts to avoid side-channel vulnerabilities.
PARAMETER TYPE WIDENING Skip type hints when overriding parent class methods class ArrayClass { public function foo(array $foo) { /* ... */ } } // This RFC proposes allowing the type // to be widened to be untyped aka any // type can be passed as the parameter. // Any type restrictions can be done // via user code in the method body. class EverythingClass extends ArrayClass { public function foo($foo) { /* ... */ } }
COUNTING OF NON-COUNTABLE OBJECTS Any scalar, null or object not implementing Countable will raise a Warning CONVERT NUMERIC KEYS IN OBJECT/ARRAY CASTS Numeric keys are no longer lost in the conversion $obj = (object)['1' => 1, '2' => 2, '3' => 3];
NAVIGATING THE INTERNALS NEWS 1. RFCs - the best source, sometimes abandoned or postponed a lot 2. The mailing list - old, chaotic, hard to follow 3. - internals mailing list in a nice UI 4. Twitter: and many more, because the community is awesome! 5. Blogs and 6. Externals.io @of cial_php @nikita_ppv @SaraMG @DragonBe @CalEvans PHP Weekly newsletter PRs on PHP-SRC repo on GitHub