Alpha testing for PHP 8.4 has begun

The first alpha release of the new branch of the PHP programming language 8.4 has been announced. The release is scheduled for November 21. The main innovations, already available for testing or planned for implementation in PHP 8.4:

  • Support for property hooks has been added, allowing additional logic to be executed when modifying or accessing object properties, implemented without intercepting read and write operations using common functions __get and __set, and without creating additional wrapper methods. The use of property hooks significantly reduces the amount of code and simplifies overriding the behavior of property handling by binding a custom handler to each property. class User { public string $name { set { if (strlen($value) === 0) { throw new ValueError('Name must be non-empty'); } $this->name = $value; } } public function __construct(string $name) { $this->name = $name; } }
  • It is now allowed to specify method references in the 'new' construct without separating parentheses, i.e., instead of '$name = (new MyClass())->method()', you can now specify '$name = new MyClass()->method()'.
  • Instead of the general parameter 'opcache.jit_buffer_size' for managing the JIT compiler and setting the JIT buffer size, parameters 'opcache.jit' and 'opcache.jit_buffer_size' have been proposed. To disable JIT, you can now specify 'opcache.jit=disable' instead of 'opcache.jit_buffer_size=0'. Additionally, changes have been made to reduce memory consumption and improve JIT performance in certain situations.
  • The behavior that automatically allowed assignment of null values for function parameters with a default value of null has been deprecated. To enable such parameters to accept null values, an explicit prefix '?' is now required. For example, instead of 'function save(Book $book = null) {}', you should specify 'function save(?Book $book = null) {}'.
  • The class \Dom\HTMLDocument has been implemented, supporting correct parsing of HTML5 markup.
  • The function request_parse_body() has been added for parsing HTTP requests with the content type multipart/form-data (RFC1867).

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster