Lately in PHP
February - May 4, 2019
Longhorn PHP 2019
Lately in PHP
February - May 4, 2019
Longhorn PHP 2019
PHP 7.4 & PHP 8
Official PHP Repo: github.com/php/php-src
● Master branch === PHP 8
○ Ex. github.com/php/php-src/blob/master/UPGRADING
● Dev branch === PHP 7.4
○ Ex. github.com/php/php-src/blob/PHP-7.4/UPGRADING
Upcoming Features via PHP RFC
Unbundle ext/interbase
● Target: PHP 7.4
● tl;dr: ext/interbase is no longer maintained, bye
● Note: PDO-firebird is safe, for now
● See: wiki.php.net/rfc/deprecate-and-remove-ext-interbase
Upcoming Features via PHP RFC
Weak references
● Target: PHP 7.4
● tl;dr: Allows for easier caching of objects
● Note: Does not affect garbage collection
● See: wiki.php.net/rfc/weakrefs
Upcoming Features via PHP RFC
FFI - Foreign Function Interface
● Target: PHP 7.4
● tl;dr: ever wanted to use raw
C in PHP?
● See: wiki.php.net/rfc/ffi
<?php
// create FFI object, loading libc and exporting
function printf()
$ffi = FFI::cdef(
"int printf(const char *format, ...);", // this is
regular C declaration
"libc.so.6");
// call C printf()
$ffi->printf("Hello %s!n", "world");
Upcoming Features via PHP RFC
Deprecate short-open tags in PHP
● Target: PHP 7.4
● tl;dr: <? phpinfo(); <?php phpinfo();
● See: wiki.php.net/rfc/deprecate_php_short_tags
Upcoming Features via PHP RFC
Arrow Functions and Short Closures
● Target: PHP 7.4
● tl;dr: cleaner closures!
● See: wiki.php.net/rfc/arrow_functions_v2
function array_values_from_keys ($arr,
$keys) {
return array_map(function ($x) use
($arr)
{ return $arr[$x]; }, $keys);
}
Becomes:
function array_values_from_keys ($arr,
$keys) {
return array_map(
fn($x) => $arr[$x],
$keys
);
}
Upcoming Features via PHP RFC
Consistent Type Errors for Internal Functions
● Target: PHP 8.0
● tl;dr: Catch the sanity
● See: wiki.php.net/rfc/consistent_type_errors
Upcoming Features via PHP RFC
JIT: Just In Time compiler
● Target: PHP 8.0
● tl;dr: Compile at run-time the portions of the code that are CPU-bound
● Note: CPU-bound code will see a speed improvement; IO-bound will not
● Note: debugging will most likely mean turning off JIT for that xdebug session
● See: https://wiki.php.net/rfc/jit
CMSes: Drupal
Drupal 8.7
● Removed: PHP 5 support
● Removed: IE9, IE10 support
● New: Layout Builder
● New: JSON:API
CMSes: WordPress
WordPress 5.2
● Release scheduled for 7 May
● New Features:
○ Site Health Check
○ Fatal Error Recovery Mode
○ Privacy and a11y updates
○ New Dashicons
○ Block Editor upgrades
● See: wordpress.org/news/2019/05/the-month-in-wordpress-april-2019/
μFrameworks - Slim
Slim 4 alpha
● PSR-15 Middleware support
● Decouple Slim PSR-7 so any PSR-7 can be used
● Decouple Pimple dependency in favor of any PSR-11 ContainerInterface
● Decouple FastRoute in favor of any routing library
● Decouple error handling & response in favor of user’s preference
● See: slimframework.com/2019/04/25/slim-4.0.0-alpha-release.html
Frameworks - CakePHP
CakePHP 3.8.0 RC1
● Some additional methods added to classes
● See: book.cakephp.org/3.next/en/appendices/3-8-migration-guide.html
Frameworks - Laravel
Laravel 5.8
● Released 26 February
● Changes:
○ Automatic Policy resolution
○ PHP dotenv 3.0
○ Carbon v1 or v2
○ Cache TTL now in seconds rather than minutes
○ Deprecates String & Array helpers
● See: laravel-news.com/laravel-5-8
Frameworks - Symfony
Symfony 4.3 soon!
● Some deprecations
● Improved Workflow
● More validators, assertions, and Constraints
● Routing improvements
● Console hyperlinks
● See: symfony.com/blog/category/living-on-the-edge/4.3
Frameworks - Zend
Now: Laminas
● Moving from Zend / RogueWave to Linux Foundation
● Target: 2019 Q2 or Q3
● Will require namespace changes
● See: getlaminas.org
PHP: The Right Way
● Note: Every open-source project can use your help with documentation. What
are you waiting for?
○ See: NomadPHP Lightning Talk: “Your First PR: How to Contribute to Open-Source Projects”
■ youtu.be/a5foPCInZZ0
● See: phptherightway.com
PHP Conferences
Longhorn PHP 2019
● May 2-4 - Austin, TX
● See: longhornphp.com
200OK
● May 17 - Tulsa, OK
● See: 200ok.us
php[tek] 2019
● May 21-23 - Atlanta, GA
● tek.phparch.com
Flyover Camp 2019
● May 31-June 2 - Kansas City, MO
● flyovercamp.org
WordCamp KC 2019
● June 28-29 - Kansas City, MO
● See: 2019.kansascity.wordcamp.org
PHP Conferences - Continued
KCDC 2019
● July 17-19 - Kansas City, MO
● kcdc.info
Laracon VII
● July 24-25 - New York, NY
● laracon.us
CoderCruise
● August 19-23 - Bahamas
● See: codercruise.com
Cascadia PHP 2019
● September 19-21 - Portland, OR
● cascadiaphp.com
Scotland PHP 2019
● November 8-9 - Edinburgh, Scotland, UK
● conference.scotlandphp.co.uk
Nomad PHP (Online) - May 16
Nomad PHP EU - 01:00 PM CDT
Git Legit
● Pauline Vos (@vanamerongen)
● nomadphp.com/live/5fuXGW7jW04sEEAM
AEuEs0/Git-Legit
Nomad PHP US - 08:00 PM CDT
Write Less Complex, More Readable Code
● Jason McCreary (@gonedark)
● nomadphp.com/live/4pRkSRIlZKKi79OuIf
WJHx/Write-less-complex--more-readable-
code
Thank you!
● Comments? Concerns? Anything that I missed?
● JoindIn: joind.in/event/longhorn-php-conference-2019/lately-in-php

Lately in php - 2019 May 4

  • 1.
    Lately in PHP February- May 4, 2019 Longhorn PHP 2019
  • 2.
    Lately in PHP February- May 4, 2019 Longhorn PHP 2019
  • 3.
    PHP 7.4 &PHP 8 Official PHP Repo: github.com/php/php-src ● Master branch === PHP 8 ○ Ex. github.com/php/php-src/blob/master/UPGRADING ● Dev branch === PHP 7.4 ○ Ex. github.com/php/php-src/blob/PHP-7.4/UPGRADING
  • 4.
    Upcoming Features viaPHP RFC Unbundle ext/interbase ● Target: PHP 7.4 ● tl;dr: ext/interbase is no longer maintained, bye ● Note: PDO-firebird is safe, for now ● See: wiki.php.net/rfc/deprecate-and-remove-ext-interbase
  • 5.
    Upcoming Features viaPHP RFC Weak references ● Target: PHP 7.4 ● tl;dr: Allows for easier caching of objects ● Note: Does not affect garbage collection ● See: wiki.php.net/rfc/weakrefs
  • 6.
    Upcoming Features viaPHP RFC FFI - Foreign Function Interface ● Target: PHP 7.4 ● tl;dr: ever wanted to use raw C in PHP? ● See: wiki.php.net/rfc/ffi <?php // create FFI object, loading libc and exporting function printf() $ffi = FFI::cdef( "int printf(const char *format, ...);", // this is regular C declaration "libc.so.6"); // call C printf() $ffi->printf("Hello %s!n", "world");
  • 7.
    Upcoming Features viaPHP RFC Deprecate short-open tags in PHP ● Target: PHP 7.4 ● tl;dr: <? phpinfo(); <?php phpinfo(); ● See: wiki.php.net/rfc/deprecate_php_short_tags
  • 8.
    Upcoming Features viaPHP RFC Arrow Functions and Short Closures ● Target: PHP 7.4 ● tl;dr: cleaner closures! ● See: wiki.php.net/rfc/arrow_functions_v2 function array_values_from_keys ($arr, $keys) { return array_map(function ($x) use ($arr) { return $arr[$x]; }, $keys); } Becomes: function array_values_from_keys ($arr, $keys) { return array_map( fn($x) => $arr[$x], $keys ); }
  • 9.
    Upcoming Features viaPHP RFC Consistent Type Errors for Internal Functions ● Target: PHP 8.0 ● tl;dr: Catch the sanity ● See: wiki.php.net/rfc/consistent_type_errors
  • 10.
    Upcoming Features viaPHP RFC JIT: Just In Time compiler ● Target: PHP 8.0 ● tl;dr: Compile at run-time the portions of the code that are CPU-bound ● Note: CPU-bound code will see a speed improvement; IO-bound will not ● Note: debugging will most likely mean turning off JIT for that xdebug session ● See: https://wiki.php.net/rfc/jit
  • 11.
    CMSes: Drupal Drupal 8.7 ●Removed: PHP 5 support ● Removed: IE9, IE10 support ● New: Layout Builder ● New: JSON:API
  • 12.
    CMSes: WordPress WordPress 5.2 ●Release scheduled for 7 May ● New Features: ○ Site Health Check ○ Fatal Error Recovery Mode ○ Privacy and a11y updates ○ New Dashicons ○ Block Editor upgrades ● See: wordpress.org/news/2019/05/the-month-in-wordpress-april-2019/
  • 13.
    μFrameworks - Slim Slim4 alpha ● PSR-15 Middleware support ● Decouple Slim PSR-7 so any PSR-7 can be used ● Decouple Pimple dependency in favor of any PSR-11 ContainerInterface ● Decouple FastRoute in favor of any routing library ● Decouple error handling & response in favor of user’s preference ● See: slimframework.com/2019/04/25/slim-4.0.0-alpha-release.html
  • 14.
    Frameworks - CakePHP CakePHP3.8.0 RC1 ● Some additional methods added to classes ● See: book.cakephp.org/3.next/en/appendices/3-8-migration-guide.html
  • 15.
    Frameworks - Laravel Laravel5.8 ● Released 26 February ● Changes: ○ Automatic Policy resolution ○ PHP dotenv 3.0 ○ Carbon v1 or v2 ○ Cache TTL now in seconds rather than minutes ○ Deprecates String & Array helpers ● See: laravel-news.com/laravel-5-8
  • 16.
    Frameworks - Symfony Symfony4.3 soon! ● Some deprecations ● Improved Workflow ● More validators, assertions, and Constraints ● Routing improvements ● Console hyperlinks ● See: symfony.com/blog/category/living-on-the-edge/4.3
  • 17.
    Frameworks - Zend Now:Laminas ● Moving from Zend / RogueWave to Linux Foundation ● Target: 2019 Q2 or Q3 ● Will require namespace changes ● See: getlaminas.org
  • 18.
    PHP: The RightWay ● Note: Every open-source project can use your help with documentation. What are you waiting for? ○ See: NomadPHP Lightning Talk: “Your First PR: How to Contribute to Open-Source Projects” ■ youtu.be/a5foPCInZZ0 ● See: phptherightway.com
  • 19.
    PHP Conferences Longhorn PHP2019 ● May 2-4 - Austin, TX ● See: longhornphp.com 200OK ● May 17 - Tulsa, OK ● See: 200ok.us php[tek] 2019 ● May 21-23 - Atlanta, GA ● tek.phparch.com Flyover Camp 2019 ● May 31-June 2 - Kansas City, MO ● flyovercamp.org WordCamp KC 2019 ● June 28-29 - Kansas City, MO ● See: 2019.kansascity.wordcamp.org
  • 20.
    PHP Conferences -Continued KCDC 2019 ● July 17-19 - Kansas City, MO ● kcdc.info Laracon VII ● July 24-25 - New York, NY ● laracon.us CoderCruise ● August 19-23 - Bahamas ● See: codercruise.com Cascadia PHP 2019 ● September 19-21 - Portland, OR ● cascadiaphp.com Scotland PHP 2019 ● November 8-9 - Edinburgh, Scotland, UK ● conference.scotlandphp.co.uk
  • 21.
    Nomad PHP (Online)- May 16 Nomad PHP EU - 01:00 PM CDT Git Legit ● Pauline Vos (@vanamerongen) ● nomadphp.com/live/5fuXGW7jW04sEEAM AEuEs0/Git-Legit Nomad PHP US - 08:00 PM CDT Write Less Complex, More Readable Code ● Jason McCreary (@gonedark) ● nomadphp.com/live/4pRkSRIlZKKi79OuIf WJHx/Write-less-complex--more-readable- code
  • 22.
    Thank you! ● Comments?Concerns? Anything that I missed? ● JoindIn: joind.in/event/longhorn-php-conference-2019/lately-in-php