Are there any specific PHP tips for optimizing performance in 2019?

One way to optimize PHP performance in 2019 is to use opcode caching. Opcode caching stores precompiled script bytecode in memory, reducing the overhead of parsing and compiling PHP scripts on each request. This can significantly improve the performance of PHP applications.

// Enable opcode caching in PHP
// Example using OPcache extension
if (!extension_loaded('Zend OPcache')) {
    die('OPcache extension is not loaded');
}

// Enable OPcache
opcache_enable();