Major update to the popular scripting language also features performance and syntax improvements and new stand-alone types. A major update to the stalwart scripting language for web development, PHP 8.2 has arrived with performance, syntax, and type safety improvements along with new capabilities such as read-only classes and stand-alone types. PHP 8.2 was published December 8 and can be accessed from php.net. Support for read-only classes in PHP 8.2 means that a class marked with the readonly modifier will mark all instance properties of the class as read-only and prevent the creation of dynamic properties. Marking readonly classes with the AllowDynamicProperties attribute triggers a compile error. The addition of null, false, and true as stand-alone types in PHP 8.2 is described as a “programming enhancement.” The null type corresponds to PHP’s unit type (the type that holds a single value) while false and true are literal types of type bool. These changes promote type system completeness and serve a number of edge cases. In other improvements in PHP 8.2: Disjunctive normal form (DNF) types enable the combination of union and intersection types, following a strict rule that says when combining union and intersection types, intersection types must be grouped with brackets. A “random” extension provides an object-oriented API to random number generation. The creation of dynamic properties has been deprecated, to help avoid mistakes and typos, unless the class opts in by using the AllowDynamicProperties attribute; stdclass allows dynamic properties. New classes, interfaces, and functions are featured, such as a msqli_execute_query function and a SensitiveParameter attribute. Constants now can be defined in traits. The ${} string interpolation has been deprecated. PHP 8.1, which featured new capabilities regarding enums, syntax, and read-only properties, arrived in November 2021. It was followed by several point releases. Related content feature What is Rust? Safe, fast, and easy software development Unlike most programming languages, Rust doesn't make you choose between speed, safety, and ease of use. Find out how Rust delivers better code with fewer compromises, and a few downsides to consider before learning Rust. By Serdar Yegulalp Nov 20, 2024 11 mins Rust Programming Languages Software Development how-to Kotlin for Java developers: Classes and coroutines Kotlin was designed to bring more flexibility and flow to programming in the JVM. Here's an in-depth look at how Kotlin makes working with classes and objects easier and introduces coroutines to modernize concurrency. By Matthew Tyson Nov 20, 2024 9 mins Java Kotlin Programming Languages news F# 9 adds nullable reference types Latest version of Microsoft’s functional .NEt programming language provides a type-safe way to handle reference types that can have null as a valid value. By Paul Krill Nov 18, 2024 3 mins Microsoft .NET Programming Languages Software Development news Go language evolving for future hardware, AI workloads The Go team is working to adapt Go to large multicore systems, the latest hardware instructions, and the needs of developers of large-scale AI systems. By Paul Krill Nov 15, 2024 3 mins Google Go Generative AI Programming Languages Resources Videos