quotes legacy • array_key_exists() with objects • FILTER_SANITIZE_MAGIC_QUOTES ﬁlter • Reﬂection export() methods • mb_strrpos() with encoding as 3rd argument • implode() parameter order mix • Unbinding $this from non-static closures • hebrevc() function • convert_cyr_string() function • money_format() function • ezmlm_hash() function • restore_include_path() function • allow_url_include ini directive
ext/mbstring. While the two latter extensions rely on POSIX iconv support or libiconv, and the bundled libmbﬂ, respectively, ext/recode relies on the Recode library which is decomissioned and had its latest release on 22 January 2001.
will throw a single E_WARNING, as accessing ($a) // is attempting to access a IS_VAR chain that is NULL. // Output would be: // Warning: Variable of type boolean does not accept array offsets https://3v4l.org/QL5Gq
will throw an E_WARNING, as accessing $a is valid //  is accessing an integer as an array. // Output would be: // Warning: Variable of type integer does not accept array offsets https://3v4l.org/v1E9J
var_dump($a + $c); // This will through 2 E_WARNINGS, First would be $a // For the same reason as above, $a is rightfully NULL // and accessing  on null is invalid. The second, // would be $c for the same reason. // Output: // int(0) https://3v4l.org/V8qHp
etc) are very accepting with their input arguments, you can pass any string to to them and they give a best effort of converting it. For example base_convert(“hello world”, 16, 10); will return 237 with no warnings. What this does internally is base_convert(“ed”, 16, 10); https://3v4l.org/3Jbem Also negative numbers simply do not work, eg base_convert(“-ff”, 16, 10); will return 255. (similar to above the “-” gets silently ignored). https://3v4l.org/nTaIL
the same $this->request->data['comments']['user_id'] = $this->request->data['comments']['user_id'] ?? 'value'; // Instead of repeating variables with long names, the equal coalesce operator is used $this->request->data['comments']['user_id'] ??= 'value';
to combine the generality of Serializable with the implementation approach of __sleep()/__wakeup(). Two new magic methods are added: // Returns array containing all the necessary state of the object. public function __serialize(): array; // Restores the object state from the given data array. public function __unserialize(array $data): void;
loading libc and exporting function printf() $ffi = FFI::cdef( "int printf(const char *format, ...);", // this is a regular C declaration "libc.so.6"); // call C's printf() $ffi->printf("Hello %s!\n", "world"); ?>
memory ◦ Manual process via “preload ﬁle” • Everything is available for all following requests • Preloaded classes are now as fast as native function (strlen, \Exception, etc…) • Server restart is needed to “refresh” code
var/cache/dev/srcApp_KernelDevDebugContainer.preload.php // This file has been auto-generated by the Symfony Dependency Injection Component // You can reference it in the "opcache.preload" php.ini setting on PHP >= 7.4 when preloading is desired use Symfony\Component\DependencyInjection\Dumper\Preloader; require dirname(__DIR__, 3).'/vendor/autoload.php'; require __DIR__.'/ContainerZxvZ783/srcApp_KernelDevDebugContainer.php'; $classes = ; $classes = 'App\Kernel'; Preloader::preload($classes);
keep the discussion going here as a central point for people interested in the topic to coordinate. But just to be clear, I am fairly conﬁdent that in the near future we are not going to add anything to Composer relating to preloading. If in a year it turns out - after people have been playing with it - that there is something Composer is uniquely positioned to really help with, we can revisit. For now it seems to me much more like an application/deployment concern than a dependency management one.