Major update to PHP adds support for declaring class, interface, trait, and enum constant types. Readonly properties and randomness also get attention. Credit: David Lofink PHP 8.3, a major update to the popular server-side web scripting language, offers features such as explicit typing of class constants, deep cloning of readonly properties, and additions to randomness functionality. Released November 23, PHP 8.3 can be accessed from php.net. With typed class constants, PHP 8.3 gains support for declaring class, interface, trait, and enum constant types. Class constant type declarations support all type declarations supported by PHP, with the exception of void, callable, and never. The void and callable types are not supported due to issues discussed in the typed properties v2 RFC. Similarly, never is not applicable in the context of constants. To enable deep cloning of readonly properties, PHP 8.3 allows readonly properties to be modified once within the magic __clone method. Plus, readonly classes now can be reinitialized during cloning. PHP 8.3 also lets non-readonly classes extend readonly classes. Other new features and improvements in PHP 8.3: A new [#Override] attribute expresses intent in code. If this attribute is added to a method, the engine shall validate that a method with the same name exists in a parent class or any of the implemented interfaces. If no such method exists, a compile time error shall be emitted.</li> <li>The command line linter now accepts variadic input for file names to lint.</li> <li>The <a href="https://www.php.net/releases/8.2/en.php#random_extension" rel="nofollow">Random Extension</a> added in PHP 8.2 adds a new method that generates random strings consisting of specific bytes only. This method allows developers to easily generate random identifiers, such as domain names, and numeric strings of arbitrary length.</li> <li>A a new function, <code>json_validate(), indicates whether a string contains valid JSON. Anonymous classes now can be readonly. PHP 8.2 arrived last December, introducing readonly classes. 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